@hackage streaming0.1.0.4

A free monad transformer optimized for streaming applications.

Stream can be used wherever FreeT is used. The compiler is better able to optimize operations written in terms of Stream.

See the examples in Streaming.Prelude for a sense of things. It closely follows Pipes.Prelude, and focused on on employment with a base functor like ((,) a) (here called Of a) which generates effectful sequences or producers - Pipes.Producer, Conduit.Source, IOStreams.InputStream, IOStreams.Generator and the like.

Interoperation with pipes is accomplished with this isomorphism, which uses Pipes.Prelude.unfoldr from HEAD:

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 iostreams is thus:

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

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

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