You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes one has a iter.Seq and needs a iter.Seq2 or vice versa. On example could be slices.Backward, which results in a iter.Seq2 and slices.Collect which takes an iter.Seq
Proposed are two mapping functions:
// Map21 returns an iterator over f applied to seq.funcMap21[KIn, VIn, Outany](ffunc(KIn, VIn) Out, seq iter.Seq2[KIn, VIn]) iter.Seq[Out]
// Map12 returns an iterator over f applied to seq.funcMap12[In, KOut, VOutany](ffunc(In) (KOut, VOut), seq iter.Seq[In]) iter.Seq2[KOut, VOut]
and two convenience functions:
// Values returns an iterator over seq with the first elements dropped.funcValues[KIn, VInany](seq iter.Seq2[KIn, VIn]) iter.Seq[VIn]
// Sequence2 returns a counted iterator over seq.funcSequence2[Inany](seq iter.Seq[In]) iter.Seq2[int, In]
Proposal Details
Sometimes one has a iter.Seq and needs a iter.Seq2 or vice versa. On example could be
slices.Backward
, which results in aiter.Seq2
andslices.Collect
which takes aniter.Seq
Proposed are two mapping functions:
and two convenience functions:
With the following implementation ( Go playground):
The text was updated successfully, but these errors were encountered: