cardano-ledger-binary-1.3.3.0: Binary serialization library used throughout ledger
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Binary.Plain

Contents

Description

Module that re-exports everythign from `cardano-binary` package.

Everything that gets defined in this module should most likely be migrated to `cardano-binary` package.

Synopsis

Documentation

data Tokens Source #

A flattened representation of a term, which is independent of any underlying binary representation, but which we later serialise into CBOR format.

Since: cborg-0.2.0.0

Instances

Instances details
Show Tokens 
Instance details

Defined in Codec.CBOR.Encoding

Eq Tokens 
Instance details

Defined in Codec.CBOR.Encoding

Methods

(==)TokensTokensBool Source #

(/=)TokensTokensBool Source #

ToCBOR (TokensTokens) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBOR ∷ (TokensTokens) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (TokensTokens) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [TokensTokens] → Size Source #

EncCBOR (TokensTokens) Source # 
Instance details

Defined in Cardano.Ledger.Binary.Encoding.EncCBOR

Methods

encCBOR ∷ (TokensTokens) → Encoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy (TokensTokens) → Size Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [TokensTokens] → Size Source #

newtype Encoding Source #

An intermediate form used during serialisation, specified as a Monoid. It supports efficient concatenation, and is equivalent to a specialised Endo Tokens type.

It is used for the stage in serialisation where we flatten out the Haskell data structure but it is independent of any specific external binary or text format.

Traditionally, to build any arbitrary Encoding value, you specify larger structures from smaller ones and append the small ones together using mconcat.

Since: cborg-0.2.0.0

Constructors

Encoding (TokensTokens) 

Instances

Instances details
Monoid Encoding

Since: cborg-0.2.0.0

Instance details

Defined in Codec.CBOR.Encoding

Semigroup Encoding

Since: cborg-0.2.0.0

Instance details

Defined in Codec.CBOR.Encoding

Show Encoding 
Instance details

Defined in Codec.CBOR.Encoding

ToCBOR Encoding 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBOREncodingEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy EncodingSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Encoding] → Size Source #

EncCBOR Encoding Source # 
Instance details

Defined in Cardano.Ledger.Binary.Encoding.EncCBOR

Methods

encCBOREncodingEncoding0 Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy EncodingSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [Encoding] → Size Source #

encodeWordWordEncoding Source #

Encode a Word in a flattened format.

Since: cborg-0.2.0.0

encodeWord8Word8Encoding Source #

Encode a Word8 in a flattened format.

Since: cborg-0.2.0.0

encodeWord16Word16Encoding Source #

Encode a Word16 in a flattened format.

Since: cborg-0.2.0.0

encodeWord32Word32Encoding Source #

Encode a Word32 in a flattened format.

Since: cborg-0.2.0.0

encodeWord64Word64Encoding Source #

Encode a Word64 in a flattened format.

Since: cborg-0.2.0.0

encodeIntIntEncoding Source #

Encode an Int in a flattened format.

Since: cborg-0.2.0.0

encodeInt8Int8Encoding Source #

Encode an Int8 in a flattened format.

Since: cborg-0.2.0.0

encodeInt16Int16Encoding Source #

Encode an Int16 in a flattened format.

Since: cborg-0.2.0.0

encodeInt32Int32Encoding Source #

Encode an Int32 in a flattened format.

Since: cborg-0.2.0.0

encodeInt64Int64Encoding Source #

Encode an @Int64 in a flattened format.

Since: cborg-0.2.0.0

encodeIntegerIntegerEncoding Source #

Encode an arbitrarily large @Integer in a flattened format.

Since: cborg-0.2.0.0

encodeBytesByteStringEncoding Source #

Encode an arbitrary strict ByteString in a flattened format.

Since: cborg-0.2.0.0

encodeByteArraySlicedByteArrayEncoding Source #

Encode a bytestring in a flattened format.

Since: cborg-0.2.0.0

encodeBytesIndefEncoding Source #

Encode a token specifying the beginning of a string of bytes of indefinite length. In reality, this specifies a stream of many occurrences of encodeBytes, each specifying a single chunk of the overall string. After all the bytes desired have been encoded, you should follow it with a break token (see encodeBreak).

Since: cborg-0.2.0.0

encodeStringTextEncoding Source #

Encode a Text in a flattened format.

Since: cborg-0.2.0.0

encodeStringIndefEncoding Source #

Encode the beginning of an indefinite string.

Since: cborg-0.2.0.0

encodeUtf8ByteArraySlicedByteArrayEncoding Source #

Encode a UTF-8 string in a flattened format. Note that the contents is not validated to be well-formed UTF-8.

Since: cborg-0.2.0.0

encodeListLenWordEncoding Source #

Encode the length of a list, used to indicate that the following tokens represent the list values.

Since: cborg-0.2.0.0

encodeListLenIndefEncoding Source #

Encode a token specifying that this is the beginning of an indefinite list of unknown size. Tokens representing the list are expected afterwords, followed by a break token (see encodeBreak) when the list has ended.

Since: cborg-0.2.0.0

encodeMapLenWordEncoding Source #

Encode the length of a Map, used to indicate that the following tokens represent the map values.

Since: cborg-0.2.0.0

encodeMapLenIndefEncoding Source #

Encode a token specifying that this is the beginning of an indefinite map of unknown size. Tokens representing the map are expected afterwords, followed by a break token (see encodeBreak) when the map has ended.

Since: cborg-0.2.0.0

encodeBreakEncoding Source #

Encode a 'break', used to specify the end of indefinite length objects like maps or lists.

Since: cborg-0.2.0.0

encodeTagWordEncoding Source #

Encode an arbitrary Word tag.

Since: cborg-0.2.0.0

encodeTag64Word64Encoding Source #

Encode an arbitrary 64-bit Word64 tag.

Since: cborg-0.2.0.0

encodeBoolBoolEncoding Source #

Encode a Bool.

Since: cborg-0.2.0.0

encodeUndefEncoding Source #

Encode an Undef value.

Since: cborg-0.2.0.0

encodeNullEncoding Source #

Encode a Null value.

Since: cborg-0.2.0.0

encodeSimpleWord8Encoding Source #

Encode a 'simple' CBOR token that can be represented with an 8-bit word. You probably don't ever need this.

Since: cborg-0.2.0.0

encodeFloat16FloatEncoding Source #

Encode a small 16-bit Float in a flattened format.

Since: cborg-0.2.0.0

encodeFloatFloatEncoding Source #

Encode a full precision Float in a flattened format.

Since: cborg-0.2.0.0

encodeDoubleDoubleEncoding Source #

Encode a Double in a flattened format.

Since: cborg-0.2.0.0

encodePreEncodedByteStringEncoding Source #

Include pre-encoded valid CBOR data into the Encoding.

The data is included into the output as-is without any additional wrapper.

This should be used with care. The data must be a valid CBOR encoding, but this is not checked.

This is useful when you have CBOR data that you know is already valid, e.g. previously validated and stored on disk, and you wish to include it without having to decode and re-encode it.

Since: cborg-0.2.2.0

type ByteOffset = Int64 Source #

A 0-based offset within the overall byte sequence that makes up the input to the Decoder.

This is an Int64 since Decoder is incremental and can decode more data than fits in memory at once. This is also compatible with the result type of length.

data TokenType Source #

The type of a token, which a decoder can ask for at an arbitrary time.

Since: cborg-0.2.0.0

data DecodeAction s a Source #

An action, representing a step for a decoder to taken and a continuation to invoke with the expected value.

Since: cborg-0.2.0.0

Constructors

ConsumeWord (Word#ST s (DecodeAction s a)) 
ConsumeWord8 (Word#ST s (DecodeAction s a)) 
ConsumeWord16 (Word#ST s (DecodeAction s a)) 
ConsumeWord32 (Word#ST s (DecodeAction s a)) 
ConsumeNegWord (Word#ST s (DecodeAction s a)) 
ConsumeInt (Int#ST s (DecodeAction s a)) 
ConsumeInt8 (Int#ST s (DecodeAction s a)) 
ConsumeInt16 (Int#ST s (DecodeAction s a)) 
ConsumeInt32 (Int#ST s (DecodeAction s a)) 
ConsumeListLen (Int#ST s (DecodeAction s a)) 
ConsumeMapLen (Int#ST s (DecodeAction s a)) 
ConsumeTag (Word#ST s (DecodeAction s a)) 
ConsumeInteger (IntegerST s (DecodeAction s a)) 
ConsumeFloat (Float#ST s (DecodeAction s a)) 
ConsumeDouble (Double#ST s (DecodeAction s a)) 
ConsumeBytes (ByteStringST s (DecodeAction s a)) 
ConsumeByteArray (ByteArrayST s (DecodeAction s a)) 
ConsumeString (TextST s (DecodeAction s a)) 
ConsumeUtf8ByteArray (ByteArrayST s (DecodeAction s a)) 
ConsumeBool (BoolST s (DecodeAction s a)) 
ConsumeSimple (Word#ST s (DecodeAction s a)) 
ConsumeBytesIndef (ST s (DecodeAction s a)) 
ConsumeStringIndef (ST s (DecodeAction s a)) 
ConsumeListLenIndef (ST s (DecodeAction s a)) 
ConsumeMapLenIndef (ST s (DecodeAction s a)) 
ConsumeNull (ST s (DecodeAction s a)) 
ConsumeListLenOrIndef (Int#ST s (DecodeAction s a)) 
ConsumeMapLenOrIndef (Int#ST s (DecodeAction s a)) 
ConsumeBreakOr (BoolST s (DecodeAction s a)) 
PeekTokenType (TokenTypeST s (DecodeAction s a)) 
PeekAvailable (Int#ST s (DecodeAction s a)) 
PeekByteOffset (Int#ST s (DecodeAction s a)) 
ConsumeWordCanonical (Word#ST s (DecodeAction s a)) 
ConsumeWord8Canonical (Word#ST s (DecodeAction s a)) 
ConsumeWord16Canonical (Word#ST s (DecodeAction s a)) 
ConsumeWord32Canonical (Word#ST s (DecodeAction s a)) 
ConsumeNegWordCanonical (Word#ST s (DecodeAction s a)) 
ConsumeIntCanonical (Int#ST s (DecodeAction s a)) 
ConsumeInt8Canonical (Int#ST s (DecodeAction s a)) 
ConsumeInt16Canonical (Int#ST s (DecodeAction s a)) 
ConsumeInt32Canonical (Int#ST s (DecodeAction s a)) 
ConsumeListLenCanonical (Int#ST s (DecodeAction s a)) 
ConsumeMapLenCanonical (Int#ST s (DecodeAction s a)) 
ConsumeTagCanonical (Word#ST s (DecodeAction s a)) 
ConsumeIntegerCanonical (IntegerST s (DecodeAction s a)) 
ConsumeFloat16Canonical (Float#ST s (DecodeAction s a)) 
ConsumeFloatCanonical (Float#ST s (DecodeAction s a)) 
ConsumeDoubleCanonical (Double#ST s (DecodeAction s a)) 
ConsumeBytesCanonical (ByteStringST s (DecodeAction s a)) 
ConsumeByteArrayCanonical (ByteArrayST s (DecodeAction s a)) 
ConsumeStringCanonical (TextST s (DecodeAction s a)) 
ConsumeUtf8ByteArrayCanonical (ByteArrayST s (DecodeAction s a)) 
ConsumeSimpleCanonical (Word#ST s (DecodeAction s a)) 
Fail String 
Done a 

liftSTST s a → Decoder s a Source #

Lift an ST action into a Decoder. Useful for, e.g., leveraging in-place mutation to efficiently build a deserialised value.

Since: cborg-0.2.0.0

getDecodeActionDecoder s a → ST s (DecodeAction s a) Source #

Given a Decoder, give us the DecodeAction

Since: cborg-0.2.0.0

decodeWordDecoder s Word Source #

Decode a Word.

Since: cborg-0.2.0.0

decodeWord8Decoder s Word8 Source #

Decode a Word8.

Since: cborg-0.2.0.0

decodeWord16Decoder s Word16 Source #

Decode a Word16.

Since: cborg-0.2.0.0

decodeWord32Decoder s Word32 Source #

Decode a Word32.

Since: cborg-0.2.0.0

decodeWord64Decoder s Word64 Source #

Decode a Word64.

Since: cborg-0.2.0.0

decodeNegWordDecoder s Word Source #

Decode a negative Word.

Since: cborg-0.2.0.0

decodeNegWord64Decoder s Word64 Source #

Decode a negative Word64.

Since: cborg-0.2.0.0

decodeIntDecoder s Int Source #

Decode an Int.

Since: cborg-0.2.0.0

decodeInt8Decoder s Int8 Source #

Decode an Int8.

Since: cborg-0.2.0.0

decodeInt16Decoder s Int16 Source #

Decode an Int16.

Since: cborg-0.2.0.0

decodeInt32Decoder s Int32 Source #

Decode an Int32.

Since: cborg-0.2.0.0

decodeInt64Decoder s Int64 Source #

Decode an Int64.

Since: cborg-0.2.0.0

decodeWordCanonicalDecoder s Word Source #

Decode canonical representation of a Word.

Since: cborg-0.2.0.0

decodeWord8CanonicalDecoder s Word8 Source #

Decode canonical representation of a Word8.

Since: cborg-0.2.0.0

decodeWord16CanonicalDecoder s Word16 Source #

Decode canonical representation of a Word16.

Since: cborg-0.2.0.0

decodeWord32CanonicalDecoder s Word32 Source #

Decode canonical representation of a Word32.

Since: cborg-0.2.0.0

decodeWord64CanonicalDecoder s Word64 Source #

Decode canonical representation of a Word64.

Since: cborg-0.2.0.0

decodeNegWordCanonicalDecoder s Word Source #

Decode canonical representation of a negative Word.

Since: cborg-0.2.0.0

decodeNegWord64CanonicalDecoder s Word64 Source #

Decode canonical representation of a negative Word64.

Since: cborg-0.2.0.0

decodeIntCanonicalDecoder s Int Source #

Decode canonical representation of an Int.

Since: cborg-0.2.0.0

decodeInt8CanonicalDecoder s Int8 Source #

Decode canonical representation of an Int8.

Since: cborg-0.2.0.0

decodeInt16CanonicalDecoder s Int16 Source #

Decode canonical representation of an Int16.

Since: cborg-0.2.0.0

decodeInt32CanonicalDecoder s Int32 Source #

Decode canonical representation of an Int32.

Since: cborg-0.2.0.0

decodeInt64CanonicalDecoder s Int64 Source #

Decode canonical representation of an Int64.

Since: cborg-0.2.0.0

decodeIntegerDecoder s Integer Source #

Decode an Integer.

Since: cborg-0.2.0.0

decodeFloatDecoder s Float Source #

Decode a Float.

Since: cborg-0.2.0.0

decodeDoubleDecoder s Double Source #

Decode a Double.

Since: cborg-0.2.0.0

decodeBytesDecoder s ByteString Source #

Decode a string of bytes as a ByteString.

Since: cborg-0.2.0.0

decodeBytesCanonicalDecoder s ByteString Source #

Decode canonical representation of a string of bytes as a ByteString.

Since: cborg-0.2.1.0

decodeBytesIndefDecoder s () Source #

Decode a token marking the beginning of an indefinite length set of bytes.

Since: cborg-0.2.0.0

decodeByteArrayDecoder s ByteArray Source #

Decode a string of bytes as a ByteArray.

Also note that this will eagerly copy the content out of the input to ensure that the input does not leak in the event that the ByteArray is live but not forced.

Since: cborg-0.2.0.0

decodeByteArrayCanonicalDecoder s ByteArray Source #

Decode canonical representation of a string of bytes as a ByteArray.

Also note that this will eagerly copy the content out of the input to ensure that the input does not leak in the event that the ByteArray is live but not forced.

Since: cborg-0.2.1.0

decodeStringDecoder s Text Source #

Decode a textual string as a piece of Text.

Since: cborg-0.2.0.0

decodeStringCanonicalDecoder s Text Source #

Decode canonical representation of a textual string as a piece of Text.

Since: cborg-0.2.1.0

decodeStringIndefDecoder s () Source #

Decode a token marking the beginning of an indefinite length string.

Since: cborg-0.2.0.0

decodeUtf8ByteArrayDecoder s ByteArray Source #

Decode a textual string as UTF-8 encoded ByteArray. Note that the result is not validated to be well-formed UTF-8.

Also note that this will eagerly copy the content out of the input to ensure that the input does not leak in the event that the ByteArray is live but not forced.

Since: cborg-0.2.0.0

decodeUtf8ByteArrayCanonicalDecoder s ByteArray Source #

Decode canonical representation of a textual string as UTF-8 encoded ByteArray. Note that the result is not validated to be well-formed UTF-8.

Also note that this will eagerly copy the content out of the input to ensure that the input does not leak in the event that the ByteArray is live but not forced.

Since: cborg-0.2.1.0

decodeListLenDecoder s Int Source #

Decode the length of a list.

Since: cborg-0.2.0.0

decodeListLenCanonicalDecoder s Int Source #

Decode canonical representation of the length of a list.

Since: cborg-0.2.0.0

decodeListLenIndefDecoder s () Source #

Decode a token marking the beginning of a list of indefinite length.

Since: cborg-0.2.0.0

decodeMapLenDecoder s Int Source #

Decode the length of a map.

Since: cborg-0.2.0.0

decodeMapLenCanonicalDecoder s Int Source #

Decode canonical representation of the length of a map.

Since: cborg-0.2.0.0

decodeMapLenIndefDecoder s () Source #

Decode a token marking the beginning of a map of indefinite length.

Since: cborg-0.2.0.0

decodeTagDecoder s Word Source #

Decode an arbitrary tag and return it as a Word.

Since: cborg-0.2.0.0

decodeTag64Decoder s Word64 Source #

Decode an arbitrary 64-bit tag and return it as a Word64.

Since: cborg-0.2.0.0

decodeTagCanonicalDecoder s Word Source #

Decode canonical representation of an arbitrary tag and return it as a Word.

Since: cborg-0.2.0.0

decodeTag64CanonicalDecoder s Word64 Source #

Decode canonical representation of an arbitrary 64-bit tag and return it as a Word64.

Since: cborg-0.2.0.0

decodeBoolDecoder s Bool Source #

Decode a bool.

Since: cborg-0.2.0.0

decodeNullDecoder s () Source #

Decode a nullary value, and return a unit value.

Since: cborg-0.2.0.0

decodeSimpleDecoder s Word8 Source #

Decode a simple CBOR value and give back a Word8. You probably don't ever need to use this.

Since: cborg-0.2.0.0

decodeIntegerCanonicalDecoder s Integer Source #

Decode canonical representation of an Integer.

Since: cborg-0.2.0.0

decodeFloat16CanonicalDecoder s Float Source #

Decode canonical representation of a half-precision Float.

Since: cborg-0.2.0.0

decodeFloatCanonicalDecoder s Float Source #

Decode canonical representation of a Float.

Since: cborg-0.2.0.0

decodeDoubleCanonicalDecoder s Double Source #

Decode canonical representation of a Double.

Since: cborg-0.2.0.0

decodeSimpleCanonicalDecoder s Word8 Source #

Decode canonical representation of a simple CBOR value and give back a Word8. You probably don't ever need to use this.

Since: cborg-0.2.0.0

decodeWordOf Source #

Arguments

Word

Expected value of the decoded word

Decoder s () 

Attempt to decode a word with decodeWord, and ensure the word is exactly as expected, or fail.

Since: cborg-0.2.0.0

decodeListLenOfIntDecoder s () Source #

Attempt to decode a list length using decodeListLen, and ensure it is exactly the specified length, or fail.

Since: cborg-0.2.0.0

decodeWordCanonicalOf Source #

Arguments

Word

Expected value of the decoded word

Decoder s () 

Attempt to decode canonical representation of a word with decodeWordCanonical, and ensure the word is exactly as expected, or fail.

Since: cborg-0.2.0.0

decodeListLenCanonicalOfIntDecoder s () Source #

Attempt to decode canonical representation of a list length using decodeListLenCanonical, and ensure it is exactly the specified length, or fail.

Since: cborg-0.2.0.0

decodeListLenOrIndefDecoder s (Maybe Int) Source #

Attempt to decode a token for the length of a finite, known list, or an indefinite list. If Nothing is returned, then an indefinite length list occurs afterwords. If Just x is returned, then a list of length x is encoded.

Since: cborg-0.2.0.0

decodeMapLenOrIndefDecoder s (Maybe Int) Source #

Attempt to decode a token for the length of a finite, known map, or an indefinite map. If Nothing is returned, then an indefinite length map occurs afterwords. If Just x is returned, then a map of length x is encoded.

Since: cborg-0.2.0.0

decodeBreakOrDecoder s Bool Source #

Attempt to decode a Break token, and if that was successful, return True. If the token was of any other type, return False.

Since: cborg-0.2.0.0

peekTokenTypeDecoder s TokenType Source #

Peek at the current token we're about to decode, and return a TokenType specifying what it is.

Since: cborg-0.2.0.0

peekAvailableDecoder s Int Source #

Peek and return the length of the current buffer that we're running our decoder on.

Since: cborg-0.2.0.0

peekByteOffsetDecoder s ByteOffset Source #

Get the current ByteOffset in the input byte sequence of the Decoder.

The Decoder does not provide any facility to get at the input data directly (since that is tricky with an incremental decoder). The next best is this primitive which can be used to keep track of the offset within the input bytes that makes up the encoded form of a term.

By keeping track of the byte offsets before and after decoding a subterm (a pattern captured by decodeWithByteSpan) and if the overall input data is retained then this is enables later retrieving the span of bytes for the subterm.

Since: cborg-0.2.2.0

decodeWithByteSpanDecoder s a → Decoder s (a, ByteOffset, ByteOffset) Source #

This captures the pattern of getting the byte offsets before and after decoding a subterm.

!before <- peekByteOffset
x <- decode
!after  <- peekByteOffset

decodeSequenceLenIndef ∷ (r → a → r) → r → (r → r') → Decoder s a → Decoder s r' Source #

Decode an indefinite sequence length.

Since: cborg-0.2.0.0

decodeSequenceLenN ∷ (r → a → r) → r → (r → r') → IntDecoder s a → Decoder s r' Source #

Decode a sequence length.

Since: cborg-0.2.0.0

data Decoder s a Source #

A continuation-based decoder, used for decoding values that were previously encoded using the Codec.CBOR.Encoding module. As Decoder has a Monad instance, you can easily write Decoders monadically for building your deserialisation logic.

Since: cborg-0.2.0.0

Instances

Instances details
MonadFail (Decoder s)

Since: cborg-0.2.0.0

Instance details

Defined in Codec.CBOR.Decoding

Methods

failStringDecoder s a Source #

Applicative (Decoder s)

Since: cborg-0.2.0.0

Instance details

Defined in Codec.CBOR.Decoding

Methods

pure ∷ a → Decoder s a Source #

(<*>)Decoder s (a → b) → Decoder s a → Decoder s b Source #

liftA2 ∷ (a → b → c) → Decoder s a → Decoder s b → Decoder s c Source #

(*>)Decoder s a → Decoder s b → Decoder s b Source #

(<*)Decoder s a → Decoder s b → Decoder s a Source #

Functor (Decoder s)

Since: cborg-0.2.0.0

Instance details

Defined in Codec.CBOR.Decoding

Methods

fmap ∷ (a → b) → Decoder s a → Decoder s b Source #

(<$) ∷ a → Decoder s b → Decoder s a Source #

Monad (Decoder s)

Since: cborg-0.2.0.0

Instance details

Defined in Codec.CBOR.Decoding

Methods

(>>=)Decoder s a → (a → Decoder s b) → Decoder s b Source #

(>>)Decoder s a → Decoder s b → Decoder s b Source #

return ∷ a → Decoder s a Source #

encodeNestedCborBytesByteStringEncoding Source #

Like encodeNestedCbor, but assumes nothing about the shape of input object, so that it must be passed as a binary ByteString blob. It's the caller responsibility to ensure the input ByteString correspond indeed to valid, previously-serialised CBOR data.

encodeNestedCborToCBOR a ⇒ a → Encoding Source #

Encode and serialise the given a and sorround it with the semantic tag 24 In CBOR diagnostic notation: >>> 24(hDEADBEEF)

serializeEncodingEncodingByteString Source #

Serialize a Haskell value to an external binary representation using the provided CBOR Encoding

The output is represented as an LByteString and is constructed incrementally.

serializeBuilderToCBOR a ⇒ a → Builder Source #

Serialize into a Builder. Useful if you want to throw other ByteStrings around it.

serialize'ToCBOR a ⇒ a → ByteString Source #

Serialize a Haskell value to an external binary representation.

The output is represented as a strict ByteString.

serializeToCBOR a ⇒ a → ByteString Source #

Serialize a Haskell value with a ToCBOR instance to an external binary representation.

The output is represented as a lazy LByteString and is constructed incrementally.

encodeNullMaybe ∷ (a → Encoding) → Maybe a → Encoding Source #

Alternative way to encode a Maybe type.

Note - this is not the default method for encoding Maybe, use encodeMaybe instead

toCBORMaybe ∷ (a → Encoding) → Maybe a → Encoding Source #

encodeMaybe ∷ (a → Encoding) → Maybe a → Encoding Source #

encodeSeq ∷ (a → Encoding) → Seq a → Encoding Source #

encodeNominalDiffTimeMicroNominalDiffTimeEncoding Source #

Same as encodeNominalDiffTime, except with loss of precision, because it encoded as Micro

withWordSize ∷ (Integral s, Integral a) ⇒ s → a Source #

Compute encoded size of an integer

szForceSizeSize Source #

Force any thunks in the given Size expression.

ghci> putStrLn $ pretty $ szForce $ szLazy (Proxy @TxAux)
(0 + { TxAux=(2 + ((0 + (_ :: Tx)) + (_ :: Vector TxInWitness))) })

szSimplifySizeEither Size (Range Natural) Source #

Simplify the given Size, resulting in either the simplified Size or, if it was fully simplified, an explicit upper and lower bound.

szWithCtxToCBOR a ⇒ Map TypeRep SizeOverrideProxy a → Size Source #

Greedily compute the size bounds for a type, using the given context to override sizes for specific types.

apMonoText → (NaturalNatural) → SizeSize Source #

Apply a monotonically increasing function to the expression. There are three cases when applying f to a Size expression: * When applied to a value x, compute f x. * When applied to cases, apply to each case individually. * In all other cases, create a deferred application of f.

isTodoSizeBool Source #

Is this expression a thunk?

szGreedyToCBOR a ⇒ Proxy a → Size Source #

Evaluate an expression greedily. There may still be thunks in the result, for types that did not provide a custom encodedSizeExpr method in their ToCBOR instance.

ghci> putStrLn $ pretty $ szGreedy (Proxy @TxAux)
(0 + { TxAux=(2 + ((0 + (((1 + (2 + ((_ :: LengthOf [TxIn]) * (2 + { TxInUtxo=(2 + ((1 + 34) + { minBound=1 maxBound=5 })) })))) + (2 + ((_ :: LengthOf [TxOut]) * (0 + { TxOut=(2 + ((0 + ((2 + ((2 + withWordSize((((1 + 30) + (_ :: Attributes AddrAttributes)) + 1))) + (((1 + 30) + (_ :: Attributes AddrAttributes)) + 1))) + { minBound=1 maxBound=5 })) + { minBound=1 maxBound=9 })) })))) + (_ :: Attributes ()))) + (_ :: Vector TxInWitness))) })

szLazyToCBOR a ⇒ Proxy a → Size Source #

Evaluate the expression lazily, by immediately creating a thunk that will evaluate its contents lazily.

ghci> putStrLn $ pretty $ szLazy (Proxy @TxAux)
(_ :: TxAux)

szEval ∷ (∀ t. ToCBOR t ⇒ (Proxy t → Size) → Proxy t → Range Natural) → SizeRange Natural Source #

Fully evaluate a size expression by applying the given function to any suspended computations. szEval g effectively turns each "thunk" of the form TodoF f x into g x, then evaluates the result.

caseValueCase t → t Source #

Discard the label on a case.

szCases ∷ [Case Size] → Size Source #

Create a case expression from individual cases.

class Typeable a ⇒ ToCBOR a where Source #

Minimal complete definition

toCBOR

Methods

toCBOR ∷ a → Encoding Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [a] → Size Source #

Instances

Instances details
ToCBOR Void 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORVoidEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy VoidSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Void] → Size Source #

ToCBOR Int32 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORInt32Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy Int32Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Int32] → Size Source #

ToCBOR Int64 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORInt64Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy Int64Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Int64] → Size Source #

ToCBOR Word16 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORWord16Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy Word16Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Word16] → Size Source #

ToCBOR Word32 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORWord32Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy Word32Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Word32] → Size Source #

ToCBOR Word64 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORWord64Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy Word64Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Word64] → Size Source #

ToCBOR Word8 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORWord8Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy Word8Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Word8] → Size Source #

ToCBOR ByteString 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORByteStringEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ByteStringSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ByteString] → Size Source #

ToCBOR ByteString 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORByteStringEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ByteStringSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ByteString] → Size Source #

ToCBOR ShortByteString 
Instance details

Defined in Cardano.Binary.ToCBOR

ToCBOR Point 
Instance details

Defined in Cardano.Crypto.VRF.Simple

Methods

toCBOR ∷ Point → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy Point → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Point] → Size Source #

ToCBOR Proof 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Methods

toCBORProofEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ProofSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Proof] → Size Source #

ToCBOR SignKey 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Methods

toCBORSignKeyEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy SignKeySize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SignKey] → Size Source #

ToCBOR VerKey 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Methods

toCBORVerKeyEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy VerKeySize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [VerKey] → Size Source #

ToCBOR Proof 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Methods

toCBOR ∷ Proof → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy Proof → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Proof] → Size Source #

ToCBOR SignKey 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Methods

toCBOR ∷ SignKey → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy SignKey → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SignKey] → Size Source #

ToCBOR VerKey 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Methods

toCBOR ∷ VerKey → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy VerKey → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [VerKey] → Size Source #

ToCBOR Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

Methods

toCBORVersionEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy VersionSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Version] → Size Source #

ToCBOR BlockNo 
Instance details

Defined in Cardano.Slotting.Block

Methods

toCBORBlockNoEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy BlockNoSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [BlockNo] → Size Source #

ToCBOR EpochInterval 
Instance details

Defined in Cardano.Slotting.Slot

ToCBOR EpochNo 
Instance details

Defined in Cardano.Slotting.Slot

Methods

toCBOREpochNoEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy EpochNoSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [EpochNo] → Size Source #

ToCBOR EpochSize 
Instance details

Defined in Cardano.Slotting.Slot

Methods

toCBOREpochSizeEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy EpochSizeSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [EpochSize] → Size Source #

ToCBOR SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

Methods

toCBORSlotNoEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy SlotNoSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SlotNo] → Size Source #

ToCBOR RelativeTime 
Instance details

Defined in Cardano.Slotting.Time

Methods

toCBORRelativeTimeEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy RelativeTimeSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [RelativeTime] → Size Source #

ToCBOR SlotLength 
Instance details

Defined in Cardano.Slotting.Time

Methods

toCBORSlotLengthEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy SlotLengthSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SlotLength] → Size Source #

ToCBOR SystemStart 
Instance details

Defined in Cardano.Slotting.Time

Methods

toCBORSystemStartEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy SystemStartSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SystemStart] → Size Source #

ToCBOR Encoding 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBOREncodingEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy EncodingSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Encoding] → Size Source #

ToCBOR Term 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORTermEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy TermSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Term] → Size Source #

ToCBOR Text 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORTextEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy TextSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Text] → Size Source #

ToCBOR UTCTime 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORUTCTimeEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy UTCTimeSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [UTCTime] → Size Source #

ToCBOR Integer 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORIntegerEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy IntegerSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Integer] → Size Source #

ToCBOR Natural 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORNaturalEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy NaturalSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Natural] → Size Source #

ToCBOR () 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBOR ∷ () → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy () → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [()] → Size Source #

ToCBOR Bool 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORBoolEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy BoolSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Bool] → Size Source #

ToCBOR Double 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORDoubleEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy DoubleSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Double] → Size Source #

ToCBOR Float 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORFloatEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy FloatSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Float] → Size Source #

ToCBOR Int 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORIntEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy IntSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Int] → Size Source #

ToCBOR Word 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORWordEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy WordSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Word] → Size Source #

ToCBOR a ⇒ ToCBOR (Ratio a) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORRatio a → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Ratio a) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Ratio a] → Size Source #

Typeable xs ⇒ ToCBOR (LengthOf xs) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORLengthOf xs → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (LengthOf xs) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [LengthOf xs] → Size Source #

ToCBOR (SigDSIGN EcdsaSecp256k1DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.EcdsaSecp256k1

ToCBOR (SigDSIGN Ed25519DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Ed25519

ToCBOR (SigDSIGN Ed448DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Ed448

ToCBOR (SigDSIGN MockDSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Mock

ToCBOR (SigDSIGN SchnorrSecp256k1DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.SchnorrSecp256k1

ToCBOR (SignKeyDSIGN EcdsaSecp256k1DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.EcdsaSecp256k1

ToCBOR (SignKeyDSIGN Ed25519DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Ed25519

ToCBOR (SignKeyDSIGN Ed448DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Ed448

ToCBOR (SignKeyDSIGN MockDSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Mock

ToCBOR (SignKeyDSIGN SchnorrSecp256k1DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.SchnorrSecp256k1

ToCBOR (VerKeyDSIGN EcdsaSecp256k1DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.EcdsaSecp256k1

ToCBOR (VerKeyDSIGN Ed25519DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Ed25519

ToCBOR (VerKeyDSIGN Ed448DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Ed448

ToCBOR (VerKeyDSIGN MockDSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Mock

ToCBOR (VerKeyDSIGN SchnorrSecp256k1DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.SchnorrSecp256k1

DSIGNAlgorithm d ⇒ ToCBOR (SigKES (CompactSingleKES d)) 
Instance details

Defined in Cardano.Crypto.KES.CompactSingle

(OptimizedKESAlgorithm d, HashAlgorithm h) ⇒ ToCBOR (SigKES (CompactSumKES h d)) 
Instance details

Defined in Cardano.Crypto.KES.CompactSum

Methods

toCBORSigKES (CompactSumKES h d) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (SigKES (CompactSumKES h d)) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SigKES (CompactSumKES h d)] → Size Source #

KnownNat t ⇒ ToCBOR (SigKES (MockKES t)) 
Instance details

Defined in Cardano.Crypto.KES.Mock

Methods

toCBORSigKES (MockKES t) → Encoding Source #

encodedSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy (SigKES (MockKES t)) → Size Source #

encodedListSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy [SigKES (MockKES t)] → Size Source #

(DSIGNAlgorithm d, KnownNat t, KnownNat (SeedSizeDSIGN d * t)) ⇒ ToCBOR (SigKES (SimpleKES d t)) 
Instance details

Defined in Cardano.Crypto.KES.Simple

Methods

toCBORSigKES (SimpleKES d t) → Encoding Source #

encodedSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy (SigKES (SimpleKES d t)) → Size Source #

encodedListSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy [SigKES (SimpleKES d t)] → Size Source #

DSIGNAlgorithm d ⇒ ToCBOR (SigKES (SingleKES d)) 
Instance details

Defined in Cardano.Crypto.KES.Single

Methods

toCBORSigKES (SingleKES d) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (SigKES (SingleKES d)) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SigKES (SingleKES d)] → Size Source #

(KESAlgorithm d, HashAlgorithm h) ⇒ ToCBOR (SigKES (SumKES h d)) 
Instance details

Defined in Cardano.Crypto.KES.Sum

Methods

toCBORSigKES (SumKES h d) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (SigKES (SumKES h d)) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SigKES (SumKES h d)] → Size Source #

DSIGNAlgorithm d ⇒ ToCBOR (SignKeyKES (CompactSingleKES d)) 
Instance details

Defined in Cardano.Crypto.KES.CompactSingle

(OptimizedKESAlgorithm d, HashAlgorithm h) ⇒ ToCBOR (SignKeyKES (CompactSumKES h d)) 
Instance details

Defined in Cardano.Crypto.KES.CompactSum

Methods

toCBORSignKeyKES (CompactSumKES h d) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (SignKeyKES (CompactSumKES h d)) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SignKeyKES (CompactSumKES h d)] → Size Source #

KnownNat t ⇒ ToCBOR (SignKeyKES (MockKES t)) 
Instance details

Defined in Cardano.Crypto.KES.Mock

Methods

toCBORSignKeyKES (MockKES t) → Encoding Source #

encodedSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy (SignKeyKES (MockKES t)) → Size Source #

encodedListSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy [SignKeyKES (MockKES t)] → Size Source #

(DSIGNAlgorithm d, KnownNat t, KnownNat (SeedSizeDSIGN d * t)) ⇒ ToCBOR (SignKeyKES (SimpleKES d t)) 
Instance details

Defined in Cardano.Crypto.KES.Simple

Methods

toCBORSignKeyKES (SimpleKES d t) → Encoding Source #

encodedSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy (SignKeyKES (SimpleKES d t)) → Size Source #

encodedListSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy [SignKeyKES (SimpleKES d t)] → Size Source #

DSIGNAlgorithm d ⇒ ToCBOR (SignKeyKES (SingleKES d)) 
Instance details

Defined in Cardano.Crypto.KES.Single

Methods

toCBORSignKeyKES (SingleKES d) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (SignKeyKES (SingleKES d)) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SignKeyKES (SingleKES d)] → Size Source #

(KESAlgorithm d, HashAlgorithm h) ⇒ ToCBOR (SignKeyKES (SumKES h d)) 
Instance details

Defined in Cardano.Crypto.KES.Sum

Methods

toCBORSignKeyKES (SumKES h d) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (SignKeyKES (SumKES h d)) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SignKeyKES (SumKES h d)] → Size Source #

DSIGNAlgorithm d ⇒ ToCBOR (VerKeyKES (CompactSingleKES d)) 
Instance details

Defined in Cardano.Crypto.KES.CompactSingle

(OptimizedKESAlgorithm d, HashAlgorithm h) ⇒ ToCBOR (VerKeyKES (CompactSumKES h d)) 
Instance details

Defined in Cardano.Crypto.KES.CompactSum

Methods

toCBORVerKeyKES (CompactSumKES h d) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (VerKeyKES (CompactSumKES h d)) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [VerKeyKES (CompactSumKES h d)] → Size Source #

KnownNat t ⇒ ToCBOR (VerKeyKES (MockKES t)) 
Instance details

Defined in Cardano.Crypto.KES.Mock

Methods

toCBORVerKeyKES (MockKES t) → Encoding Source #

encodedSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy (VerKeyKES (MockKES t)) → Size Source #

encodedListSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy [VerKeyKES (MockKES t)] → Size Source #

(DSIGNAlgorithm d, KnownNat t, KnownNat (SeedSizeDSIGN d * t)) ⇒ ToCBOR (VerKeyKES (SimpleKES d t)) 
Instance details

Defined in Cardano.Crypto.KES.Simple

Methods

toCBORVerKeyKES (SimpleKES d t) → Encoding Source #

encodedSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy (VerKeyKES (SimpleKES d t)) → Size Source #

encodedListSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy [VerKeyKES (SimpleKES d t)] → Size Source #

DSIGNAlgorithm d ⇒ ToCBOR (VerKeyKES (SingleKES d)) 
Instance details

Defined in Cardano.Crypto.KES.Single

Methods

toCBORVerKeyKES (SingleKES d) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (VerKeyKES (SingleKES d)) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [VerKeyKES (SingleKES d)] → Size Source #

(KESAlgorithm d, HashAlgorithm h) ⇒ ToCBOR (VerKeyKES (SumKES h d)) 
Instance details

Defined in Cardano.Crypto.KES.Sum

Methods

toCBORVerKeyKES (SumKES h d) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (VerKeyKES (SumKES h d)) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [VerKeyKES (SumKES h d)] → Size Source #

ToCBOR (CertVRF MockVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Mock

Methods

toCBORCertVRF MockVRFEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (CertVRF MockVRF) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [CertVRF MockVRF] → Size Source #

ToCBOR (CertVRF SimpleVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Simple

ToCBOR (CertVRF PraosVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Praos

Methods

toCBORCertVRF PraosVRFEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (CertVRF PraosVRF) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [CertVRF PraosVRF] → Size Source #

ToCBOR (CertVRF PraosBatchCompatVRF) 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Typeable v ⇒ ToCBOR (OutputVRF v) 
Instance details

Defined in Cardano.Crypto.VRF.Class

Methods

toCBOROutputVRF v → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (OutputVRF v) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [OutputVRF v] → Size Source #

ToCBOR (SignKeyVRF MockVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Mock

ToCBOR (SignKeyVRF SimpleVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Simple

ToCBOR (SignKeyVRF PraosVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Praos

ToCBOR (SignKeyVRF PraosBatchCompatVRF) 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

ToCBOR (VerKeyVRF MockVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Mock

ToCBOR (VerKeyVRF SimpleVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Simple

ToCBOR (VerKeyVRF PraosVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Praos

ToCBOR (VerKeyVRF PraosBatchCompatVRF) 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

(Serialise t, Typeable t) ⇒ ToCBOR (WithOrigin t) 
Instance details

Defined in Cardano.Slotting.Slot

Methods

toCBORWithOrigin t → Encoding Source #

encodedSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy (WithOrigin t) → Size Source #

encodedListSizeExpr ∷ (∀ t0. ToCBOR t0 ⇒ Proxy t0 → Size) → Proxy [WithOrigin t] → Size Source #

ToCBOR a ⇒ ToCBOR (StrictMaybe a) 
Instance details

Defined in Data.Maybe.Strict

Methods

toCBORStrictMaybe a → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (StrictMaybe a) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [StrictMaybe a] → Size Source #

ToCBOR a ⇒ ToCBOR (StrictSeq a) 
Instance details

Defined in Data.Sequence.Strict

Methods

toCBORStrictSeq a → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (StrictSeq a) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [StrictSeq a] → Size Source #

ToCBOR a ⇒ ToCBOR (Seq a) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORSeq a → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Seq a) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Seq a] → Size Source #

(Ord a, ToCBOR a) ⇒ ToCBOR (Set a) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORSet a → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Set a) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Set a] → Size Source #

ToCBOR a ⇒ ToCBOR (Vector a) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORVector a → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Vector a) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Vector a] → Size Source #

ToCBOR a ⇒ ToCBOR (NonEmpty a) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORNonEmpty a → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (NonEmpty a) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [NonEmpty a] → Size Source #

ToCBOR a ⇒ ToCBOR (Maybe a) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORMaybe a → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Maybe a) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Maybe a] → Size Source #

ToCBOR a ⇒ ToCBOR [a] 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBOR ∷ [a] → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [a] → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [[a]] → Size Source #

(ToCBOR a, ToCBOR b) ⇒ ToCBOR (Either a b) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBOREither a b → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Either a b) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Either a b] → Size Source #

Typeable a ⇒ ToCBOR (Fixed a) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORFixed a → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Fixed a) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Fixed a] → Size Source #

(HashAlgorithm h, Typeable a) ⇒ ToCBOR (Hash h a) 
Instance details

Defined in Cardano.Crypto.Hash.Class

Methods

toCBORHash h a → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Hash h a) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Hash h a] → Size Source #

(VRFAlgorithm v, Typeable a) ⇒ ToCBOR (CertifiedVRF v a) 
Instance details

Defined in Cardano.Crypto.VRF.Class

Methods

toCBORCertifiedVRF v a → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (CertifiedVRF v a) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [CertifiedVRF v a] → Size Source #

(Ord k, ToCBOR k, ToCBOR v) ⇒ ToCBOR (Map k v) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORMap k v → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Map k v) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Map k v] → Size Source #

ToCBOR (TokensTokens) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBOR ∷ (TokensTokens) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (TokensTokens) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [TokensTokens] → Size Source #

(ToCBOR a, ToCBOR b) ⇒ ToCBOR (a, b) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBOR ∷ (a, b) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (a, b) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [(a, b)] → Size Source #

(Typeable s, ToCBOR a) ⇒ ToCBOR (Tagged s a) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORTagged s a → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (Tagged s a) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Tagged s a] → Size Source #

(ToCBOR a, ToCBOR b, ToCBOR c) ⇒ ToCBOR (a, b, c) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBOR ∷ (a, b, c) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (a, b, c) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [(a, b, c)] → Size Source #

(ToCBOR a, ToCBOR b, ToCBOR c, ToCBOR d) ⇒ ToCBOR (a, b, c, d) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBOR ∷ (a, b, c, d) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (a, b, c, d) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [(a, b, c, d)] → Size Source #

(ToCBOR a, ToCBOR b, ToCBOR c, ToCBOR d, ToCBOR e) ⇒ ToCBOR (a, b, c, d, e) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBOR ∷ (a, b, c, d, e) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (a, b, c, d, e) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [(a, b, c, d, e)] → Size Source #

(ToCBOR a, ToCBOR b, ToCBOR c, ToCBOR d, ToCBOR e, ToCBOR f) ⇒ ToCBOR (a, b, c, d, e, f) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBOR ∷ (a, b, c, d, e, f) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (a, b, c, d, e, f) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [(a, b, c, d, e, f)] → Size Source #

(ToCBOR a, ToCBOR b, ToCBOR c, ToCBOR d, ToCBOR e, ToCBOR f, ToCBOR g) ⇒ ToCBOR (a, b, c, d, e, f, g) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBOR ∷ (a, b, c, d, e, f, g) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (a, b, c, d, e, f, g) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [(a, b, c, d, e, f, g)] → Size Source #

(ToCBOR a, ToCBOR b, ToCBOR c, ToCBOR d, ToCBOR e, ToCBOR f, ToCBOR g, ToCBOR h) ⇒ ToCBOR (a, b, c, d, e, f, g, h) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBOR ∷ (a, b, c, d, e, f, g, h) → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (a, b, c, d, e, f, g, h) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [(a, b, c, d, e, f, g, h)] → Size Source #

newtype LengthOf xs Source #

A type used to represent the length of a value in Size computations.

Constructors

LengthOf xs 

Instances

Instances details
Typeable xs ⇒ ToCBOR (LengthOf xs) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

toCBORLengthOf xs → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (LengthOf xs) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [LengthOf xs] → Size Source #

type Size = Fix SizeF Source #

Expressions describing the statically-computed size bounds on a type's possible values.

data Case t Source #

An individual labeled case.

Constructors

Case Text t 

Instances

Instances details
Functor Case 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

fmap ∷ (a → b) → Case a → Case b Source #

(<$) ∷ a → Case b → Case a Source #

Buildable t ⇒ Buildable (Case t) 
Instance details

Defined in Cardano.Binary.ToCBOR

Methods

buildCase t → Builder Source #

data Range b Source #

A range of values. Should satisfy the invariant forall x. lo x <= hi x.

Constructors

Range 

Fields

  • lo ∷ b
     
  • hi ∷ b
     

Instances

Instances details
(Ord b, Num b) ⇒ Num (Range b)

The Num instance for Range uses interval arithmetic. Note that the signum method is not lawful: if the interval x includes 0 in its interior but is not symmetric about 0, then abs x * signum x /= x.

Instance details

Defined in Cardano.Binary.ToCBOR

Methods

(+)Range b → Range b → Range b Source #

(-)Range b → Range b → Range b Source #

(*)Range b → Range b → Range b Source #

negateRange b → Range b Source #

absRange b → Range b Source #

signumRange b → Range b Source #

fromIntegerIntegerRange b Source #

Buildable (Range Natural) 
Instance details

Defined in Cardano.Binary.ToCBOR

data SizeOverride Source #

Override mechanisms to be used with szWithCtx.

Constructors

SizeConstant Size

Replace with a fixed Size.

SizeExpression ((∀ a. ToCBOR a ⇒ Proxy a → Size) → Size)

Recursively compute the size.

SelectCases [Text]

Select only a specific case from a CasesF.

decodeNestedCborBytesDecoder s ByteString Source #

Like decodeKnownCborDataItem, but assumes nothing about the Haskell type we want to deserialise back, therefore it yields the ByteString Tag 24 surrounded (stripping such tag away).

In CBOR notation, if the data was serialised as:

>>> 24(h'DEADBEEF')

then decodeNestedCborBytes yields the inner DEADBEEF, unchanged.

decodeNestedCborFromCBOR a ⇒ Decoder s a Source #

Remove the the semantic tag 24 from the enclosed CBOR data item, decoding back the inner ByteString as a proper Haskell type. Consume its input in full.

decodeFullDecoder' Source #

Arguments

Text

Label for error reporting

→ (∀ s. Decoder s a)

The parser for the ByteString to decode. It should decode the given ByteString into a value of type a

ByteString

The ByteString to decode

Either DecoderError a 

decodeFullDecoder Source #

Arguments

Text

Label for error reporting

→ (∀ s. Decoder s a)

The parser for the ByteString to decode. It should decode the given ByteString into a value of type a

ByteString

The ByteString to decode

Either DecoderError a 

decodeFullFromCBOR a ⇒ ByteStringEither DecoderError a Source #

Deserialize a Haskell value from the external binary representation, failing if there are leftovers. In a nutshell, the full here implies the contract of this function is that what you feed as input needs to be consumed entirely.

unsafeDeserialize'FromCBOR a ⇒ ByteString → a Source #

Strict variant of deserialize.

unsafeDeserializeFromCBOR a ⇒ ByteString → a Source #

Deserialize a Haskell value from the external binary representation (which must have been made using serialize or related function).

Throws: DeserialiseFailure if the given external representation is invalid or does not correspond to a value of the expected type.

cborError ∷ (MonadFail m, Buildable e) ⇒ e → m a Source #

Convert a Buildable error message into a MonadFail failure.

toCborError ∷ (MonadFail m, Buildable e) ⇒ Either e a → m a Source #

Convert an Either-encoded failure to a MonadFail failure using the Buildable insatance

decodeSeqDecoder s a → Decoder s (Seq a) Source #

decodeMapSkel ∷ (Ord k, FromCBOR k, FromCBOR v) ⇒ ([(k, v)] → m) → Decoder s m Source #

Checks canonicity by comparing the new key being decoded with the previous one, to enfore these are sorted the correct way. See: https://tools.ietf.org/html/rfc7049#section-3.9 "[..]The keys in every map must be sorted lowest value to highest.[...]"

decodeNominalDiffTimeMicroDecoder s NominalDiffTime Source #

For backwards compatibility we round pico precision to micro

decodeListWithDecoder s a → Decoder s [a] Source #

Decoder for list.

matchSizeTextIntIntDecoder s () Source #

Compare two sizes, failing if they are not equal

enforceSizeTextIntDecoder s () Source #

Enforces that the input size is the same as the decoded one, failing in case it's not

class Typeable a ⇒ FromCBOR a where Source #

Minimal complete definition

fromCBOR

Methods

fromCBORDecoder s a Source #

labelProxy a → Text Source #

Instances

Instances details
FromCBOR Void 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Int32 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Int64 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Rational 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Word16 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Word32 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Word64 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Word8 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR ByteString 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR ByteString 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR ShortByteString 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Point 
Instance details

Defined in Cardano.Crypto.VRF.Simple

Methods

fromCBORDecoder s Point Source #

labelProxy Point → Text Source #

FromCBOR Proof 
Instance details

Defined in Cardano.Crypto.VRF.Praos

FromCBOR SignKey 
Instance details

Defined in Cardano.Crypto.VRF.Praos

FromCBOR VerKey 
Instance details

Defined in Cardano.Crypto.VRF.Praos

FromCBOR Proof 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Methods

fromCBORDecoder s Proof Source #

labelProxy Proof → Text Source #

FromCBOR SignKey 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Methods

fromCBORDecoder s SignKey Source #

labelProxy SignKey → Text Source #

FromCBOR VerKey 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Methods

fromCBORDecoder s VerKey Source #

labelProxy VerKey → Text Source #

FromCBOR Version Source # 
Instance details

Defined in Cardano.Ledger.Binary.Version

FromCBOR BlockNo 
Instance details

Defined in Cardano.Slotting.Block

FromCBOR EpochInterval 
Instance details

Defined in Cardano.Slotting.Slot

FromCBOR EpochNo 
Instance details

Defined in Cardano.Slotting.Slot

FromCBOR EpochSize 
Instance details

Defined in Cardano.Slotting.Slot

FromCBOR SlotNo 
Instance details

Defined in Cardano.Slotting.Slot

FromCBOR RelativeTime 
Instance details

Defined in Cardano.Slotting.Time

FromCBOR SlotLength 
Instance details

Defined in Cardano.Slotting.Time

FromCBOR SystemStart 
Instance details

Defined in Cardano.Slotting.Time

FromCBOR TermToken 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Term 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Text 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR UTCTime 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Integer 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Natural 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR () 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s () Source #

labelProxy () → Text Source #

FromCBOR Bool 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Double 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Float 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Int 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR Word 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR (SigDSIGN EcdsaSecp256k1DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.EcdsaSecp256k1

FromCBOR (SigDSIGN Ed25519DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Ed25519

FromCBOR (SigDSIGN Ed448DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Ed448

FromCBOR (SigDSIGN MockDSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Mock

FromCBOR (SigDSIGN SchnorrSecp256k1DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.SchnorrSecp256k1

FromCBOR (SignKeyDSIGN EcdsaSecp256k1DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.EcdsaSecp256k1

FromCBOR (SignKeyDSIGN Ed25519DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Ed25519

FromCBOR (SignKeyDSIGN Ed448DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Ed448

FromCBOR (SignKeyDSIGN MockDSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Mock

FromCBOR (SignKeyDSIGN SchnorrSecp256k1DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.SchnorrSecp256k1

FromCBOR (VerKeyDSIGN EcdsaSecp256k1DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.EcdsaSecp256k1

FromCBOR (VerKeyDSIGN Ed25519DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Ed25519

FromCBOR (VerKeyDSIGN Ed448DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Ed448

FromCBOR (VerKeyDSIGN MockDSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.Mock

FromCBOR (VerKeyDSIGN SchnorrSecp256k1DSIGN) 
Instance details

Defined in Cardano.Crypto.DSIGN.SchnorrSecp256k1

DSIGNAlgorithm d ⇒ FromCBOR (SigKES (CompactSingleKES d)) 
Instance details

Defined in Cardano.Crypto.KES.CompactSingle

(OptimizedKESAlgorithm d, HashAlgorithm h) ⇒ FromCBOR (SigKES (CompactSumKES h d)) 
Instance details

Defined in Cardano.Crypto.KES.CompactSum

KnownNat t ⇒ FromCBOR (SigKES (MockKES t)) 
Instance details

Defined in Cardano.Crypto.KES.Mock

(DSIGNAlgorithm d, KnownNat t, KnownNat (SeedSizeDSIGN d * t)) ⇒ FromCBOR (SigKES (SimpleKES d t)) 
Instance details

Defined in Cardano.Crypto.KES.Simple

DSIGNAlgorithm d ⇒ FromCBOR (SigKES (SingleKES d)) 
Instance details

Defined in Cardano.Crypto.KES.Single

(KESAlgorithm d, HashAlgorithm h) ⇒ FromCBOR (SigKES (SumKES h d)) 
Instance details

Defined in Cardano.Crypto.KES.Sum

Methods

fromCBORDecoder s (SigKES (SumKES h d)) Source #

labelProxy (SigKES (SumKES h d)) → Text Source #

DSIGNAlgorithm d ⇒ FromCBOR (SignKeyKES (CompactSingleKES d)) 
Instance details

Defined in Cardano.Crypto.KES.CompactSingle

(OptimizedKESAlgorithm d, HashAlgorithm h) ⇒ FromCBOR (SignKeyKES (CompactSumKES h d)) 
Instance details

Defined in Cardano.Crypto.KES.CompactSum

KnownNat t ⇒ FromCBOR (SignKeyKES (MockKES t)) 
Instance details

Defined in Cardano.Crypto.KES.Mock

(DSIGNAlgorithm d, KnownNat t, KnownNat (SeedSizeDSIGN d * t)) ⇒ FromCBOR (SignKeyKES (SimpleKES d t)) 
Instance details

Defined in Cardano.Crypto.KES.Simple

DSIGNAlgorithm d ⇒ FromCBOR (SignKeyKES (SingleKES d)) 
Instance details

Defined in Cardano.Crypto.KES.Single

(KESAlgorithm d, HashAlgorithm h) ⇒ FromCBOR (SignKeyKES (SumKES h d)) 
Instance details

Defined in Cardano.Crypto.KES.Sum

DSIGNAlgorithm d ⇒ FromCBOR (VerKeyKES (CompactSingleKES d)) 
Instance details

Defined in Cardano.Crypto.KES.CompactSingle

(OptimizedKESAlgorithm d, HashAlgorithm h) ⇒ FromCBOR (VerKeyKES (CompactSumKES h d)) 
Instance details

Defined in Cardano.Crypto.KES.CompactSum

KnownNat t ⇒ FromCBOR (VerKeyKES (MockKES t)) 
Instance details

Defined in Cardano.Crypto.KES.Mock

(DSIGNAlgorithm d, KnownNat t, KnownNat (SeedSizeDSIGN d * t)) ⇒ FromCBOR (VerKeyKES (SimpleKES d t)) 
Instance details

Defined in Cardano.Crypto.KES.Simple

DSIGNAlgorithm d ⇒ FromCBOR (VerKeyKES (SingleKES d)) 
Instance details

Defined in Cardano.Crypto.KES.Single

(KESAlgorithm d, HashAlgorithm h) ⇒ FromCBOR (VerKeyKES (SumKES h d)) 
Instance details

Defined in Cardano.Crypto.KES.Sum

FromCBOR (CertVRF MockVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Mock

FromCBOR (CertVRF SimpleVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Simple

FromCBOR (CertVRF PraosVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Praos

FromCBOR (CertVRF PraosBatchCompatVRF) 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

Typeable v ⇒ FromCBOR (OutputVRF v) 
Instance details

Defined in Cardano.Crypto.VRF.Class

FromCBOR (SignKeyVRF MockVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Mock

FromCBOR (SignKeyVRF SimpleVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Simple

FromCBOR (SignKeyVRF PraosVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Praos

FromCBOR (SignKeyVRF PraosBatchCompatVRF) 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

FromCBOR (VerKeyVRF MockVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Mock

FromCBOR (VerKeyVRF SimpleVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Simple

FromCBOR (VerKeyVRF PraosVRF) 
Instance details

Defined in Cardano.Crypto.VRF.Praos

FromCBOR (VerKeyVRF PraosBatchCompatVRF) 
Instance details

Defined in Cardano.Crypto.VRF.PraosBatchCompat

(Serialise t, Typeable t) ⇒ FromCBOR (WithOrigin t) 
Instance details

Defined in Cardano.Slotting.Slot

FromCBOR a ⇒ FromCBOR (StrictMaybe a) 
Instance details

Defined in Data.Maybe.Strict

FromCBOR a ⇒ FromCBOR (StrictSeq a) 
Instance details

Defined in Data.Sequence.Strict

FromCBOR a ⇒ FromCBOR (Seq a) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s (Seq a) Source #

labelProxy (Seq a) → Text Source #

(Ord a, FromCBOR a) ⇒ FromCBOR (Set a) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s (Set a) Source #

labelProxy (Set a) → Text Source #

FromCBOR a ⇒ FromCBOR (Vector a) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s (Vector a) Source #

labelProxy (Vector a) → Text Source #

FromCBOR a ⇒ FromCBOR (NonEmpty a) 
Instance details

Defined in Cardano.Binary.FromCBOR

FromCBOR a ⇒ FromCBOR (Maybe a) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s (Maybe a) Source #

labelProxy (Maybe a) → Text Source #

FromCBOR a ⇒ FromCBOR [a] 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s [a] Source #

labelProxy [a] → Text Source #

(FromCBOR a, FromCBOR b) ⇒ FromCBOR (Either a b) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s (Either a b) Source #

labelProxy (Either a b) → Text Source #

Typeable a ⇒ FromCBOR (Fixed a) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s (Fixed a) Source #

labelProxy (Fixed a) → Text Source #

(HashAlgorithm h, Typeable a) ⇒ FromCBOR (Hash h a) 
Instance details

Defined in Cardano.Crypto.Hash.Class

Methods

fromCBORDecoder s (Hash h a) Source #

labelProxy (Hash h a) → Text Source #

(VRFAlgorithm v, Typeable a) ⇒ FromCBOR (CertifiedVRF v a) 
Instance details

Defined in Cardano.Crypto.VRF.Class

(Ord k, FromCBOR k, FromCBOR v) ⇒ FromCBOR (Map k v) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s (Map k v) Source #

labelProxy (Map k v) → Text Source #

(FromCBOR a, FromCBOR b) ⇒ FromCBOR (a, b) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s (a, b) Source #

labelProxy (a, b) → Text Source #

(Typeable s, FromCBOR a) ⇒ FromCBOR (Tagged s a) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s0 (Tagged s a) Source #

labelProxy (Tagged s a) → Text Source #

(FromCBOR a, FromCBOR b, FromCBOR c) ⇒ FromCBOR (a, b, c) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s (a, b, c) Source #

labelProxy (a, b, c) → Text Source #

(FromCBOR a, FromCBOR b, FromCBOR c, FromCBOR d) ⇒ FromCBOR (a, b, c, d) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s (a, b, c, d) Source #

labelProxy (a, b, c, d) → Text Source #

(FromCBOR a, FromCBOR b, FromCBOR c, FromCBOR d, FromCBOR e) ⇒ FromCBOR (a, b, c, d, e) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s (a, b, c, d, e) Source #

labelProxy (a, b, c, d, e) → Text Source #

(FromCBOR a, FromCBOR b, FromCBOR c, FromCBOR d, FromCBOR e, FromCBOR f) ⇒ FromCBOR (a, b, c, d, e, f) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s (a, b, c, d, e, f) Source #

labelProxy (a, b, c, d, e, f) → Text Source #

(FromCBOR a, FromCBOR b, FromCBOR c, FromCBOR d, FromCBOR e, FromCBOR f, FromCBOR g) ⇒ FromCBOR (a, b, c, d, e, f, g) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s (a, b, c, d, e, f, g) Source #

labelProxy (a, b, c, d, e, f, g) → Text Source #

(FromCBOR a, FromCBOR b, FromCBOR c, FromCBOR d, FromCBOR e, FromCBOR f, FromCBOR g, FromCBOR h) ⇒ FromCBOR (a, b, c, d, e, f, g, h) 
Instance details

Defined in Cardano.Binary.FromCBOR

Methods

fromCBORDecoder s (a, b, c, d, e, f, g, h) Source #

labelProxy (a, b, c, d, e, f, g, h) → Text Source #

toStrictByteString Source #

Arguments

Encoding

The Encoding of a CBOR value.

ByteString

The encoded value.

Turn an Encoding into a strict ByteString in CBOR binary format.

Since: cborg-0.2.0.0

invalidKeyMonadFail m ⇒ Word → m a Source #

Report an error when a numeric key of the type constructor doesn't match.

decodeRecordNamedText → (a → Int) → Decoder s a → Decoder s a Source #

decodeRecordNamedT ∷ (MonadTrans m, Monad (m (Decoder s))) ⇒ Text → (a → Int) → m (Decoder s) a → m (Decoder s) a Source #

decodeRecordSumText → (WordDecoder s (Int, a)) → Decoder s a Source #

decodeListLikeT Source #

Arguments

∷ (MonadTrans m, Monad (m (Decoder s))) 
Text

Name for error reporting

→ m (Decoder s) a

Decoder for the datastructure itself

→ (a → Int → m (Decoder s) ())

In case when length was provided, act upon it.

→ m (Decoder s) a 

serializeAsHexTextToCBOR a ⇒ a → Text Source #

Encode a type as CBOR and encode it as base16

decodeFullFromHexTextFromCBOR a ⇒ TextEither DecoderError a Source #

Try decoding base16 encode bytes and then try to decoding them as CBOR

encodeEnumEnum a ⇒ a → Encoding Source #

decodeEnumBounded ∷ ∀ a s. (Enum a, Bounded a, Typeable a) ⇒ Decoder s a Source #

DSIGN

KES

VRF