I'd like to be able to use take() and all the other iterator tools with a 
stream of data backed by an array (or string).

By that I mean I'd like to be able to do something like:

> stream = XXX([1,2,3,4,5])
> collect(take(stream, 3))
[1,2,3]
> collect(take(stream, 2))
[4,5]

Is this possible?  I can find heavyweight looking streams for IO, and I can 
find lightweight iterables without state.  But I can't seem to find the 
particular mix described above.

(I think I can see how to write it myself; I'm asking if it already exists 
- seems like it should, but I can't find the right words to search for).

Thanks,
Andrew

Reply via email to