Compositional pipelines.
This library offers an abstraction similar in scope to iteratees/enumerators/enumeratees, but with different characteristics and naming conventions.
This package is a fork of the original pipes package by Gabriel Gonzalez. See https://github.com/pcapriotti/pipes-core/wiki/pipes-core-vs-pipes for a comparison between the two packages.
Differences with traditional iteratees:
Simpler semantics: There is only one data type (
Pipe), two basic primitives (awaitandyield), and only one way to composePipes (>+>). In fact, (>+>) is just convenient syntax for the composition operator inCategory. Most pipes can be implemented just using theMonadinstance and composition.Different naming conventions: Enumeratees are called
Pipes, Enumerators areProducers, and Iteratees areConsumers.Producers andConsumers are just type synonyms forPipes with either the input or output end closed.Pipes form a Category: that means that composition is associative, and that there is an identity
Pipe.Verticalconcatenation works on everyPipe: (>>), concatenatesPipes. Since everything is aPipe, you can use it to concatenateProducers,Consumers, and even intermediatePipestages. Vertical concatenation can be combined with composition to create elaborate combinators, without the need of executing pipes in "passes" or resuming partially executed pipes.
Check out Control.Pipe for a copious introduction (in the spirit of the iterIO library), and Control.Pipe.Combinators for some basic combinators and Pipe examples.