-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple wrapper around Data.Binary, which adds StateT to Get/Put monads. -- -- This package declares BinaryState type class, which is similar to -- Data.Binary.Binary, but Get/Put monads can track state. @package binary-state @version 0.1 module Data.BinaryState type PutState s a = StateT s PutM a type GetState s a = StateT s Get a class BinaryState s a put :: BinaryState s a => a -> PutState s () get :: BinaryState s a => GetState s a putZ :: Binary a => a -> PutState s () getZ :: Binary a => GetState s a encodeS :: BinaryState s a => s -> a -> ByteString decodeS :: BinaryState s a => s -> ByteString -> a decodeWith :: GetState s a -> s -> ByteString -> a encodeFile :: BinaryState s a => FilePath -> s -> a -> IO () decodeFile :: BinaryState s a => FilePath -> s -> IO a decodeFile' :: BinaryState s a => FilePath -> s -> IO (a, s) getByte :: GetState s Word8 liftOffset :: Binary a => Integer -> (a -> Put) -> a -> PutState Integer () putByte :: Word8 -> PutState Integer () isEmpty :: GetState s Bool skip :: Int -> GetState s () getOffset :: PutState Integer Integer bytesRead :: GetState s Int64 instance (BinaryState s a, BinaryState s b) => BinaryState s (a, b) instance BinaryState Integer Word32 instance BinaryState Integer Word16 instance BinaryState Integer Word8 instance Binary a => BinaryState () a