Does anyone know why the return type of `Sequence&...
# stdlib
r
Does anyone know why the return type of
Sequence<T>.partition
is
Pair<List<T>, List<T>>
, and not
Pair<Sequence<T>, Sequence<T>>
? It would be nice to keep the lazyness even through a partitioning operation.
g
Interesting. I also don't see a reason why the operation should be terminal. I guess you'll have to use two `filter`s instead?
r
I guess part of the reason might be that the two resulting sequences would either be not entirely lazy or do duplicate work, because iterating one sequence to the end will also pull all elements from the source sequence that should go into the second sequence.
👌 2
âž• 1