binary-state-0.1.1: Simple wrapper around Data.Binary, which adds StateT to Get/Put monads.
Safe HaskellSafe-Inferred
LanguageHaskell98

Data.BinaryState

Documentation

type PutState s a = StateT s PutM a Source #

type GetState s a = StateT s Get a Source #

class BinaryState s a where Source #

Methods

put :: a -> PutState s () Source #

get :: GetState s a Source #

Instances

Instances details
BinaryState Integer Word8 Source # 
Instance details

Defined in Data.BinaryState

BinaryState Integer Word16 Source # 
Instance details

Defined in Data.BinaryState

BinaryState Integer Word32 Source # 
Instance details

Defined in Data.BinaryState

Binary a => BinaryState () a Source # 
Instance details

Defined in Data.BinaryState

Methods

put :: a -> PutState () () Source #

get :: GetState () a Source #

(BinaryState s a, BinaryState s b) => BinaryState s (a, b) Source # 
Instance details

Defined in Data.BinaryState

Methods

put :: (a, b) -> PutState s () Source #

get :: GetState s (a, b) Source #

putZ :: Binary a => a -> PutState s () Source #

encodeS :: BinaryState s a => s -> a -> ByteString Source #

decodeS :: BinaryState s a => s -> ByteString -> a Source #

decodeWith :: GetState s a -> s -> ByteString -> a Source #

encodeWith :: (a -> PutState s ()) -> s -> a -> ByteString Source #

encodeFile :: BinaryState s a => FilePath -> s -> a -> IO () Source #

decodeFile' :: BinaryState s a => FilePath -> s -> IO (a, s) Source #

liftOffset :: Binary a => Integer -> (a -> Put) -> a -> PutState Integer () Source #

skip :: Int -> GetState s () Source #