@hackage streaming0.1.2.0

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

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.

Note also the streaming bytestring and streaming utils packages.