hi Mark, On Wed Mar 13, 2024 at 13:32 CET, 'Mark' via golang-nuts wrote: > I've been trying to learn how to create an `All() iter.Seq[T]` method > for a > simple set type (a map wrapper): > > playground <https://go.dev/play/p/wtWvvTf33AF?v=gotip> > > It won't work in the playground of course, but when I do: > `GOEXPERIMENT=rangefunc go run .` > using Go 1.22 I get this error: > ``` > cannot use func(yield func(int, T) bool) {…} (value of type func(yield > func(int, T) bool)) as iter.Seq[T] value in return statement > ``` > Can someone help me get this right please?
IIRC, ``` return func(yield func(int, T) bool) { ... } ``` is for iter.Seq2[int,T] if you want iter.Seq[T] you should write: ``` return func (yield func(T) bool) { ... } ``` (and adapt accordingly) hth, -s -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CZSNJLMP0XKP.18U2YVQ2ZZY72%40cern.ch.