Combine
Stream combination: concat, interleave, zip, zipWith.
concat
concat: yield all elements of s1, then all elements of s2; if s1 ends immediately we forward s2 directly without rewrapping.
concat : Computation (Step r a) -> Computation (Step s a) -> Computation (Step s a)
Concatenate two streams: all elements of the first, then all of the second. Sequential, not interleaved.
interleave
interleave: alternate elements between two streams; when the leading stream ends, the trailing stream takes over uninterrupted.
interleave : Computation (Step r a) -> Computation (Step s a) -> Computation (Step null a)
Interleave two streams: alternate elements from each. When one stream ends the other continues to completion.
zip
zip: pair elements positionally into { fst, snd } records; stops when either input stream ends.
zip : Computation (Step r a) -> Computation (Step s b) -> Computation (Step null { fst : a, snd : b })
Zip two streams into a stream of pairs. Stops when either stream ends.
zipWith
zipWith: pair elements positionally and combine each pair with f; stops when either input stream ends.
zipWith : (a -> b -> c) -> Computation (Step r a) -> Computation (Step s b) -> Computation (Step null c)
Zip two streams with a combining function. Stops when either stream ends.