Suggested additions to the "swiss army knife"
wellcaffeinated opened this issue · 0 comments
wellcaffeinated commented
Here are some functions i think would be great to add to the library:
dropLast(n)
: buffer the lastn
values and once the iterator completes, drop them. Release the rest on the fly.dropWhile(predicate)
: skip values untilpredicate(value)
returnstrue
enumerate
: maps inputvalue
to[index, value]
find(predicate)
: drops values untilpredicate(value)
returnstrue
, then yields that single value and endsnth(n)
: drops values until then
th value is reached then yields that single value and ends
Additions for higher order functionality:
zip( iterators[] )
: normal zip functionality. yields arrays containing values from each iterator until all iterators end.