Safe Haskell | None |
---|---|
Language | Haskell2010 |
TypedSession.Codec
Synopsis
- newtype Encode role' ps bytes = Encode {}
- newtype Decode role' ps failure bytes = Decode {
- decode :: DecodeStep bytes failure (AnyMsg role' ps)
- data DecodeStep bytes failure a
- = DecodePartial (Maybe bytes -> DecodeStep bytes failure a)
- | DecodeDone a (Maybe bytes)
- | DecodeFail failure
- data CodecFailure
- data Channel (m :: Type -> Type) bytes = Channel {}
- runDecoderWithChannel :: Monad m => Channel m bytes -> Maybe bytes -> DecodeStep bytes failure a -> m (Either failure (a, Maybe bytes))
Documentation
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 CodecFailure Source #
Constructors
CodecFailureOutOfInput | |
CodecFailure String |
Instances
Exception CodecFailure Source # | |
Defined in TypedSession.Codec Methods toException :: CodecFailure -> SomeException # fromException :: SomeException -> Maybe CodecFailure # displayException :: CodecFailure -> String # backtraceDesired :: CodecFailure -> Bool # | |
Show CodecFailure Source # | |
Defined in TypedSession.Codec Methods showsPrec :: Int -> CodecFailure -> ShowS # show :: CodecFailure -> String # showList :: [CodecFailure] -> ShowS # | |
Eq CodecFailure Source # | |
Defined in TypedSession.Codec |
runDecoderWithChannel :: Monad m => Channel m bytes -> Maybe bytes -> DecodeStep bytes failure a -> m (Either failure (a, Maybe bytes)) Source #
Generic incremental decoding function.