IterTools.jl
IterTools.jl copied to clipboard
Alternate
Adds "Alternate", an iterator that cycles through a number of iterators until one of them runs out.
julia> println(alternate(1:5,"the",-(1:5)));
1
t
-1
2
h
-2
3
e
-3
4
I would like to call this interleave
to match interleaveby
which we added yesterday. And the microkanren paper
Sounds good to me. I don't have a strong sense of how this was implemented either because it's been a while, so make any changes you want :) (let me know if you need me to do something, I might have some time later this week)