ipldm
Safe HaskellSafe-Inferred
LanguageGHC2021

IPLD.DagCBOR.Decoder.Errors

Description

 
Synopsis

Functor for wrapping results w/ error.

type Okay = Either Error Source #

Type-alias for erroring results.

Error constructors

data Error Source #

Provides errors for parsing major-type arguments.

Constructors

EmptyAlternative

Used to implement the empty in Alternative.

TrailingBytes

When the file was parsed with trailing bytes.

Indefinite

When a collection is marked indefinite.

NotDefined

When the undefined simple value is given.

InvalidTag

When an invalid tag id is given.

InvalidIEEE754

When -∞, ∞, or NaN is encountered, these are not supported.

ReservedParam

For parameters marked reserved in RFC-8949.

Fragmented

When a section of data expects more, but there is none, leaving gaps.

UnexpectedStop

When the decoder finished unexpectedly.

UnexpectedValue

When some identifier is expected, but another is found.

DowncastFailed

When converting CBOR IntData to smaller values fail.

NotMinimal

For integers that aren't minimally encoded.

NotStringKey

When the major-type for a map isn't a string. IPLD forbids this.

NotUniqueKey

When two or more of the keys in a CBOR map are not unique.

NotSortedMap

IPLD forbids maps with non-lexographically sorted strings.

CIDError Error

Passes CID operation errors.

NotImplemented String

Marks unimplemented feature of DAG-CBOR and developement assertions.

Instances

Instances details
Show Error Source # 
Instance details

Defined in IPLD.DagCBOR.Decoder.Errors

Methods

showsPrec :: Int -> Error -> ShowS #

show :: Error -> String #

showList :: [Error] -> ShowS #

NFData Error Source #

Fully instantiates an Error object from lazy Haskell object.

Instance details

Defined in IPLD.DagCBOR.Decoder.Errors

Methods

rnf :: Error -> () #

Eq Error Source # 
Instance details

Defined in IPLD.DagCBOR.Decoder.Errors

Methods

(==) :: Error -> Error -> Bool #

(/=) :: Error -> Error -> Bool #

For resolving items and changing decoder data.

type DecoderMethod item bxc = DecoderMethod item bxc Okay Result Source #

Short hand for data model DecoderMethod in DagCBOR.

type DecoderRoutine bxc = DecoderMethod () bxc Source #

Short hand for a DecoderMethod with a Null Result item.

Results from running DecoderMethods

data Result obj bxc Source #

The Result value obj and the remaining input tokens.

Constructors

Result obj bxc 

Instances

Instances details
Bifunctor Result Source # 
Instance details

Defined in IPLD.DagCBOR.Decoder.Errors

Methods

bimap :: (a -> b) -> (c -> d) -> Result a c -> Result b d #

first :: (a -> b) -> Result a c -> Result b c #

second :: (b -> c) -> Result a b -> Result a c #

Functor (Result obj) Source # 
Instance details

Defined in IPLD.DagCBOR.Decoder.Errors

Methods

fmap :: (a -> b) -> Result obj a -> Result obj b #

(<$) :: a -> Result obj b -> Result obj a #

(Show obj, Show bxc) => Show (Result obj bxc) Source # 
Instance details

Defined in IPLD.DagCBOR.Decoder.Errors

Methods

showsPrec :: Int -> Result obj bxc -> ShowS #

show :: Result obj bxc -> String #

showList :: [Result obj bxc] -> ShowS #

(Eq obj, Eq bxc) => Eq (Result obj bxc) Source # 
Instance details

Defined in IPLD.DagCBOR.Decoder.Errors

Methods

(==) :: Result obj bxc -> Result obj bxc -> Bool #

(/=) :: Result obj bxc -> Result obj bxc -> Bool #

pattern Finish :: forall bxc. bxc -> Result () bxc Source #

Pattern synonym for routine bytes results.