typed-session-0.3.0.1: typed session framework
Safe HaskellNone
LanguageHaskell2010

TypedSession.Codec

Synopsis

Documentation

newtype Encode role' ps bytes Source #

Function to encode Msg into bytes.

Constructors

Encode 

Fields

  • encode :: forall (send :: role') (recv :: role') (st :: ps) (st' :: ps) (st'' :: ps). Msg role' ps st send st' recv st'' -> bytes
     

newtype Decode role' ps failure bytes Source #

Incremental decoding function.

Constructors

Decode 

Fields

data DecodeStep bytes failure a Source #

Generic incremental decoder constructor, you need to convert specific incremental decoders to it.

Constructors

DecodePartial (Maybe bytes -> DecodeStep bytes failure a) 
DecodeDone a (Maybe bytes) 
DecodeFail failure 

data Channel (m :: Type -> Type) bytes Source #

Bottom functions for sending and receiving bytes.

Constructors

Channel 

Fields

runDecoderWithChannel :: Monad m => Channel m bytes -> Maybe bytes -> DecodeStep bytes failure a -> m (Either failure (a, Maybe bytes)) Source #

Generic incremental decoding function.