| Copyright | Ivan Lazar Miljenovic |
|---|---|
| License | MIT |
| Maintainer | Ivan.Miljenovic@gmail.com |
| Safe Haskell | None |
| Language | Haskell2010 |
Streaming.Conduit
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.
- fromStream :: Monad m => Stream (Of o) m r -> ConduitM i o m r
- fromStreamSource :: Monad m => Stream (Of a) m r -> Source m a
- fromStreamProducer :: Monad m => Stream (Of a) m r -> Producer m a
- asConduit :: Monad m => (Stream (Of i) m () -> Stream (Of o) m r) -> Conduit i m o
- fromBStream :: Monad m => ByteString m r -> Source m ByteString
- fromBStreamProducer :: Monad m => ByteString m r -> Producer m ByteString
- toStream :: Monad m => Producer m o -> Stream (Of o) m ()
- asStream :: Monad m => Conduit i m o -> Stream (Of i) m () -> Stream (Of o) m ()
- toBStream :: Monad m => Producer m ByteString -> ByteString m ()
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.
ByteString support
fromBStream :: Monad m => ByteString m r -> Source m ByteString Source #
Convert a streaming ByteString into a Source; you probably
want to use fromBStreamProducer instead.
fromBStreamProducer :: Monad m => ByteString m r -> Producer m ByteString Source #
A more specialised variant of fromBStream that is subject to
fusion.
Converting from Conduits
ByteString support
toBStream :: Monad m => Producer m ByteString -> ByteString m () Source #
Convert a Producer to a ByteString stream. Subject to
fusion.