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

Safe Haskell | None
Language | Haskell98

Data.Conduit.Cereal.Internal

Synopsis

- type ConduitErrorHandler m o = String -> Conduit ByteString m o
- type SinkErrorHandler m r = String -> Consumer ByteString m r
- type SinkTerminationHandler m r = (ByteString -> Result r) -> Consumer ByteString m r
- mkConduitGet :: Monad m => ConduitErrorHandler m o -> Get o -> Conduit ByteString m o
- mkSinkGet :: Monad m => SinkErrorHandler m r -> SinkTerminationHandler m r -> Get r -> Consumer ByteString m r

# Documentation

type ConduitErrorHandler m o = String -> Conduit ByteString m o Source

What should we do if the Get fails?

type SinkErrorHandler m r = String -> Consumer ByteString m r Source

type SinkTerminationHandler m r = (ByteString -> Result r) -> Consumer ByteString m r Source

What should we do if the stream is done before the Get is done?

mkConduitGet :: Monad m => ConduitErrorHandler m o -> Get o -> Conduit ByteString m o Source

Construct a conduitGet with the specified `ErrorHandler`

mkSinkGet :: Monad m => SinkErrorHandler m r -> SinkTerminationHandler m r -> Get r -> Consumer ByteString m r Source

Construct a sinkGet with the specified `ErrorHandler` and `TerminationHandler`