quiver-interleave-0.2.0.2: Interleave values from multiple Quivers

Control.Quiver.Interleave

Description

Synopsis

# Documentation

spinterleave :: Monad f => (b -> b -> Ordering) -> [P a a' b () f (SPResult e)] -> P a a' b () f (SPResult e) Source #

Interleave the elements of the provided producers such that the result consists of the values from all of them merged in by the provided comparison function.

That is, if each provided Quiver returns a sequence of ordered elements, then this would be the same as obtaining all the elements and sorting them.

If any provided Quiver results in anything except SPComplete then entire stream halts, propagating the error.