You can curry a function? On Tuesday, 25 February 2025 at 18:52:09 UTC Jason E. Aten wrote:
> Hi Ian, I'm not quite understanding -- is Push meant to take an input seq > too? like > > func Push[E any](inputSeq iter.Seq[E]) (seq iter.Seq[E], yield func(E), > stop func()) > ^^^^^^^^ > ? > On Tuesday, February 25, 2025 at 6:15:40 PM UTC Ian Lance Taylor wrote: > >> On Tue, Feb 25, 2025 at 6:17 AM Nuno Cruces <ncr...@gmail.com> wrote: >> > >> > I wanted a solution that doesn't necessarily involve goroutines and >> channels, for the same reason that iter.Pull was created: because >> goroutines and channels add unnecessary parallelism that has the potential >> to introduce data races, when what is needed is concurrency without >> parallelism. >> >> I think what you're presenting is an argument for >> >> package iter >> >> // Push returns an iterator, a yield function, and a stop function. >> // The iterator will return all the values passed to the yield function. >> // The iterator will stop when the stop function is called. >> // This provides a way to flexibly convert a sequence of values into a >> Seq. >> func Push[E any]() (seq iter.Seq[E], yield func(E), stop func()) >> >> Ian >> > -- 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 visit https://groups.google.com/d/msgid/golang-nuts/b46f0864-9dfd-4c1c-b34a-dff83decae7fn%40googlegroups.com.