-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Streaming interface to binary. -- -- Streaming interface to binary. @package streaming-binary @version 0.2.1.0 -- | This module implements a method to ingest a sequence of -- Data.Binary encoded records using bounded memory. Minimal -- example: -- --
-- {-# LANGUAGE TypeApplications #-}
--
-- import Data.Function ((&))
-- import qualified Data.ByteString.Streaming as Q
-- import Streaming
-- import Streaming.Binary
-- import qualified Streaming.Prelude as S
--
-- -- Interpret all bytes on stdin as a sequence of integers.
-- -- Print them on-the-fly on stdout.
-- main = Q.getContents & decoded @Int & S.print
--
module Streaming.Binary
decode :: (Binary a, Monad m) => ByteString m r -> m (ByteString m r, Int64, Either String a)
decodeWith :: Monad m => Get a -> ByteString m r -> m (ByteString m r, Int64, Either String a)
decoded :: (Binary a, Monad m) => ByteString m r -> Stream (Of a) m (ByteString m r, Int64, Either String r)
decodedWith :: Monad m => Get a -> ByteString m r -> Stream (Of a) m (ByteString m r, Int64, Either String r)