cereal-conduit-0.0.5: Turn Data.Serialize Gets and Puts into Sources, Sinks, and Conduits

Safe HaskellSafe-Infered

Data.Conduit.Cereal

Description

Turn a Get into a Sink and a Put into a Source

Synopsis

Documentation

sinkGet :: Monad m => Get output -> Sink ByteString m (Either String output)Source

Convert a Get into a Sink. The Get will be streamed bytes until it returns Done or Fail.

If Get succeed it will return the data read and unconsumed part of the input stream. If the Get fails it will return message describing the error.

conduitGet :: Monad m => Get output -> Conduit ByteString m outputSource

Run a Get repeatedly on the input stream, producing an output stream of whatever the Get outputs.

sourcePut :: Monad m => Put -> Source m ByteStringSource

Convert a Put into a Source. Runs in constant memory.