Given a Decoder and some ByteString representing an encoded CBOR value, return Either the decoded CBOR value or an error. In addition to the decoded value return any remaining input content.
Modulecborg-0.2.10.0Haskell2010
Codec.CBOR.Read
Tools for reading values in a CBOR-encoded format back into ordinary values.
- 3 types
- 3 values
- Packagecborg-0.2.10.0
- Exports6
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceRead.hs
Given a Decoder and some ByteString representing an encoded CBOR value, return Either the decoded CBOR value or an error. In addition to the decoded value return any remaining input content and the number of bytes consumed.
Run a Decoder incrementally, returning a continuation representing the result of the incremental decode.
An exception type that may be returned (by pure functions) or thrown (by IO actions) that fail to deserialise a given input.
Constructors
Instances4Eq, Show, Exception, NFData
Eq DeserialiseFailureDefined in cborg-0.2.10.0 · Codec.CBOR.ReadShow DeserialiseFailureDefined in cborg-0.2.10.0 · Codec.CBOR.ReadException DeserialiseFailureDefined in cborg-0.2.10.0 · Codec.CBOR.ReadNFData DeserialiseFailureDefined in cborg-0.2.10.0 · Codec.CBOR.Read
An Incremental decoder, used to represent the result of
attempting to run a decoder over a given input, and return a value
of type a.
Constructors
Partial (Maybe ByteString -> ST s (IDecode s a))Done !ByteString !ByteOffset aThe decoder has successfully finished. Except for the output value you also get any unused input as well as the number of bytes consumed.
Fail !ByteString !ByteOffset DeserialiseFailureThe decoder ran into an error. The decoder either used fail or was not provided enough input. Contains any unconsumed input, the number of bytes consumed, and a DeserialiseFailure exception describing the reason why the failure occurred.