persist-state-0.2.0.0: Serialization library with state and leb128 encoding

Safe HaskellNone
LanguageHaskell2010

Data.PersistState.Internal

Contents

Synopsis

The Get type

newtype Get s a Source #

Constructors

Get 

Fields

Instances
Monad (Get s) Source # 
Instance details

Defined in Data.PersistState.Internal

Methods

(>>=) :: Get s a -> (a -> Get s b) -> Get s b #

(>>) :: Get s a -> Get s b -> Get s b #

return :: a -> Get s a #

fail :: String -> Get s a #

Functor (Get s) Source # 
Instance details

Defined in Data.PersistState.Internal

Methods

fmap :: (a -> b) -> Get s a -> Get s b #

(<$) :: a -> Get s b -> Get s a #

MonadFail (Get s) Source # 
Instance details

Defined in Data.PersistState.Internal

Methods

fail :: String -> Get s a #

Applicative (Get s) Source # 
Instance details

Defined in Data.PersistState.Internal

Methods

pure :: a -> Get s a #

(<*>) :: Get s (a -> b) -> Get s a -> Get s b #

liftA2 :: (a -> b -> c) -> Get s a -> Get s b -> Get s c #

(*>) :: Get s a -> Get s b -> Get s b #

(<*) :: Get s a -> Get s b -> Get s a #

type family GetState s Source #

data GetEnv s Source #

Constructors

GetEnv 

runGet :: Get s a -> GetState s -> ByteString -> Either String a Source #

Run the Get monad applies a get-based parser on the input ByteString

The Put type

newtype Put s a Source #

Constructors

Put 

Fields

Instances
Monad (Put s) Source # 
Instance details

Defined in Data.PersistState.Internal

Methods

(>>=) :: Put s a -> (a -> Put s b) -> Put s b #

(>>) :: Put s a -> Put s b -> Put s b #

return :: a -> Put s a #

fail :: String -> Put s a #

Functor (Put s) Source # 
Instance details

Defined in Data.PersistState.Internal

Methods

fmap :: (a -> b) -> Put s a -> Put s b #

(<$) :: a -> Put s b -> Put s a #

Applicative (Put s) Source # 
Instance details

Defined in Data.PersistState.Internal

Methods

pure :: a -> Put s a #

(<*>) :: Put s (a -> b) -> Put s a -> Put s b #

liftA2 :: (a -> b -> c) -> Put s a -> Put s b -> Put s c #

(*>) :: Put s a -> Put s b -> Put s b #

(<*) :: Put s a -> Put s b -> Put s a #

type family PutState s Source #

data PutEnv s Source #

Constructors

PutEnv 

data Chunk Source #

Constructors

Chunk 

Fields

evalPut :: Put s a -> PutState s -> (a, ByteString) Source #

grow :: Int -> Put s () Source #

Ensure that n bytes can be written.