streaming-conduit-0.1.0.0: Bidirectional support between the streaming and conduit libraries

CopyrightIvan Lazar Miljenovic
LicenseMIT
MaintainerIvan.Miljenovic@gmail.com
Safe HaskellSafe
LanguageHaskell2010

Streaming.Conduit

Contents

Description

This provides interoperability between the streaming and conduit libraries.

Not only can you convert between one streaming data representation to the other, there is also support to use one in the middle of a pipeline.

Synopsis

Converting from Streams

fromStream :: Monad m => Stream (Of o) m r -> ConduitM i o m r Source #

The result of this is slightly generic than a Source or a Producer. If it fits in the types you want, you may wish to use fromStreamProducer which is subject to fusion.

fromStreamSource :: Monad m => Stream (Of a) m r -> Source m a Source #

A type-specialised variant of fromStream that ignores the result.

fromStreamProducer :: Monad m => Stream (Of a) m r -> Producer m a Source #

A more specialised variant of fromStream that is subject to fusion.

asConduit :: Monad m => (Stream (Of i) m () -> Stream (Of o) m r) -> Conduit i m o Source #

Treat a function between Streams as a Conduit. May be subject to fusion.

Converting from Conduits

toStream :: Monad m => Producer m o -> Stream (Of o) m () Source #

Convert a Source to a Stream. Subject to fusion.

It is not possible to generalise this to be a ConduitM as input values are required. If you need such functionality, see asStream.

asStream :: Monad m => Conduit i m o -> Stream (Of i) m () -> Stream (Of o) m () Source #

Treat a Conduit as a function between Streams. Subject to fusion.