-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Integration of streamly and binary
--
-- Support for encoding/decoding using binary in
-- streamly streams.
@package streamly-binary
@version 1.0.0.1
-- | This module contains functions for decoding stream of bytestrings
-- (coming, for example, from TCP connection) to your data type using
-- binary and vice versa.
module Streamly.Binary
-- | Decode stream of bytestrings given that there exists instance of
-- Binary for target type. Bytestrings do not have to be aligned
-- in any way.
decodeStream :: (Binary a, MonadFail m) => SerialT m ByteString -> SerialT m a
-- | Decode stream of bytestrings using Get from Binary.
-- Bytestrings do not have to be aligned in any way.
decodeStreamGet :: MonadFail m => Get a -> SerialT m ByteString -> SerialT m a
-- | Encode stream of elements to bytestrings given that there exists
-- instance of Binary for source type. Resulting bytestrings are
-- not guaranteed to be aligned in any way.
encodeStream :: (Binary a, MonadFail m) => SerialT m a -> SerialT m ByteString
-- | Encode stream of elements using Put from Binary.
-- Resulting bytestrings are not guaranteed to be aligned in any way.
encodeStreamPut :: MonadFail m => (a -> Put) -> SerialT m a -> SerialT m ByteString