@hackage streaming0.1.2.2

an elementary streaming prelude and a general monad transformer for streaming applications.

Streaming.Prelude exports an elementary streaming prelude; Streaming exports a free monad transformer optimized for streaming applications and replacing FreeT. See the readme below for an explanation. Elementary usage can be divined from the ghci examples in Streaming.Prelude and from the remarks somewhat theoretical readme below, including the examples linked there. Note also the streaming bytestring and streaming utils packages.

The simplest form of interoperation with pipes is accomplished with this isomorphism:

Pipes.unfoldr Streaming.next        :: Stream (Of a) m r   -> Producer a m r
Streaming.unfoldr Pipes.next        :: Producer a m r      -> Stream (Of a) m r

Interoperation with io-streams is thus:

Streaming.reread IOStreams.read     :: InputStream a       -> Stream (Of a) IO ()
IOStreams.unfoldM Streaming.uncons  :: Stream (Of a) IO () -> IO (InputStream a)

A simple exit to conduit would be, e.g.:

Conduit.unfoldM Streaming.uncons    :: Stream (Of a) m ()  -> Source m a

These conversions should never be more expensive than a single >-> or =$=. Further points of comparison are discussed in the readme below.

Here are some results for an expansion of the little benchmarks included in the machines package: