cereal-conduit-0.0.3: Turn Data.Serialize Gets and Puts into Sources and Sinks

Safe HaskellSafe-Infered



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



sinkGet :: ResourceThrow m => Get output -> Sink ByteString m outputSource

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

If the Get fails, a GetException will be thrown with resourceThrow. This function itself can also throw a GetException.

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

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