Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype SerialiseViaFlat a = SerialiseViaFlat {
- unSerialiseViaFlat :: a
- decodeViaFlatWith :: Get a -> Decoder s a
- data DeserialiseFailureInfo = DeserialiseFailureInfo {
- dfOffset :: ByteOffset
- dfReason :: DeserialiseFailureReason
- data DeserialiseFailureReason
- readDeserialiseFailureInfo :: DeserialiseFailure -> DeserialiseFailureInfo
Documentation
newtype SerialiseViaFlat a Source #
Newtype to provide Serialise
instances for types with a Flat
instance
that just encodes the flat-serialized value as a CBOR bytestring
Instances
Flat a => Serialise (SerialiseViaFlat a) Source # | |
Defined in Codec.Extras.SerialiseViaFlat encode :: SerialiseViaFlat a -> Encoding decode :: Decoder s (SerialiseViaFlat a) encodeList :: [SerialiseViaFlat a] -> Encoding decodeList :: Decoder s [SerialiseViaFlat a] |
decodeViaFlatWith :: Get a -> Decoder s a Source #
data DeserialiseFailureInfo Source #
Similar to DeserialiseFailure
, with the difference that plain
string reason messages are turned into the datatype: DeserialiseFailureReason
.
DeserialiseFailureInfo | |
|
Instances
Show DeserialiseFailureInfo Source # | |
Defined in Codec.Extras.SerialiseViaFlat | |
Eq DeserialiseFailureInfo Source # | |
Defined in Codec.Extras.SerialiseViaFlat | |
Pretty DeserialiseFailureInfo Source # | |
Defined in Codec.Extras.SerialiseViaFlat pretty :: DeserialiseFailureInfo -> Doc ann # prettyList :: [DeserialiseFailureInfo] -> Doc ann # |
data DeserialiseFailureReason Source #
The reason of the cbor failure as a datatype, not as a plain string.
EndOfInput | Not enough input provided |
ExpectedBytes | The bytes inside the input are malformed. |
OtherReason String | This is either a cbor failure that we (plutus) are not aware of,
or an underlying flat failure. We use whatever message |
Instances
Show DeserialiseFailureReason Source # | |
Defined in Codec.Extras.SerialiseViaFlat | |
Eq DeserialiseFailureReason Source # | |
Defined in Codec.Extras.SerialiseViaFlat | |
Pretty DeserialiseFailureReason Source # | |
Defined in Codec.Extras.SerialiseViaFlat pretty :: DeserialiseFailureReason -> Doc ann # prettyList :: [DeserialiseFailureReason] -> Doc ann # |
readDeserialiseFailureInfo :: DeserialiseFailure -> DeserialiseFailureInfo Source #
The errors returned by cborg
are plain strings (untyped). With this
function we try to map onto datatypes, those cborg error messages that we are
interested in.
Currently we are only interested in error messages returned by the
decodeBytes
decoder;
see scriptCBORDecoder
.