Is your feature request related to a problem? Please describe.
The inverse of this operation already exists in it.Zip. This operation may be helpful for situations where you either wish to iterate over items at different speeds (and can accept the memory cost) or where you wish to apply functions to iter.Seqs that support iter.Seq rather than the Seq2 kind.
This is actually trickier than it sounds and I already had one aborted attempt at this, some things to consider:
Since the two iterators created by it.Unzip may consume items from the original at different speeds, unyielded but consumed values need to be stored incurring a memory cost.
In order to avoid deadlocking, the storage of the unyielded values needs to be infinite to avoid deadlocking.
The solution needs to be thread-safe between the two iterators returns by this to support concurrent iteration.
Is your feature request related to a problem? Please describe.
The inverse of this operation already exists in
it.Zip
. This operation may be helpful for situations where you either wish to iterate over items at different speeds (and can accept the memory cost) or where you wish to apply functions toiter.Seq
s that supportiter.Seq
rather than theSeq2
kind.Describe the solution you'd like
Does this incur a breaking change?
No.
Do you intend to build this feature yourself?
Yes.
Additional context
This is actually trickier than it sounds and I already had one aborted attempt at this, some things to consider:
it.Unzip
may consume items from the original at different speeds, unyielded but consumed values need to be stored incurring a memory cost.