c-cube / iter

Simple iterator abstract datatype, intended to iterate efficiently on collections while performing some transformations.
https://c-cube.github.io/iter
BSD 2-Clause "Simplified" License
118 stars 11 forks source link

zipping two sequences? #16

Closed nilsbecker closed 6 years ago

nilsbecker commented 6 years ago

I feel like I must be missing something obvious. I could not find a function 'a t -> 'b t -> ('a * 'b) t which zips the sequences, stopping when the first one runs out, or something which does the same thing but combines the sequences with a function 'a->'b->'c instead. I found only more complicated combinations. ??

nilsbecker commented 6 years ago

Ah ok, I found what I was missing: it's inherently not possible with Sequence, use Gen instead. Well...