Open nilsbecker opened 4 years ago
Well, sure, but you need inversion of control (like algebraic effects or delimcc) to write such a function, and it's terribly slow.
It's one of those function that, when you need it, you probably should figure out a way not to. :)
of_seq
is easy, it's to_seq
that'd be hard.
Oh, I misread! Yes, of_seq
is easy and pretty useful, I suppose. Although in most cases it's better to cut off the middlemen.
hm. in the current context i was using gen
and Iter.of_gen
before and was moving from gen
to Stdlib.Seq
. i then noticed that there is no equivalent of_seq
. in the meantime i figured out how to do it with OSeq.iter
. i did not really think about efficiency at all at the moment. am i doing it wrong^TM ?
to allow conversion from the stdlib generator?