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

CopyrightIvan Lazar Miljenovic
LicenseMIT
MaintainerIvan.Miljenovic@gmail.com
Safe HaskellNone
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.

No ByteString-based analogues of asConduit and asStream are provided as it would be of strictly less utility, requiring both the input and output of the ConduitM to be ByteString.

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. 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) -> ConduitM i o m r Source #

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

ByteString support

fromBStream :: Monad m => ByteString m r -> ConduitM i ByteString m r Source #

Convert a streaming ByteString into a Source; subject to fusion.

fromBStreamProducer :: Monad m => ByteString m r -> Producer m ByteString Source #

A more specialised variant of fromBStream.

Converting from Conduits

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

Convert a Producer 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.

ByteString support

toBStream :: Monad m => Producer m ByteString -> ByteString m () Source #

Convert a Producer to a ByteString stream. Subject to fusion.