Alternative implementation of the pipes concept.
The Pipe type is
Pipe a b u m r, where:
ais the input type
bis the output type
uis the upstream return type
mis the base monad
ris the return type
The primitive stream operations are:
tryAwaitwaits for upstream
yieldyields a value to downstream
Exceptions and finalization are to be decided.
There is a separate
PutbackPipe type for the purpose of preserving leftover data. It does
not form a category, and instead provides a specialized composition operator,
only permits composition on the left end of a pipeline.
simulatePipe is the fundamental abstraction for running a
Pipe. The more
runPipe is provided as a specialization.