Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
A CBOR deserialized value together with its size. When deserializing use
either decodeSized
or its DecCBOR
instance.
Use mkSized
to construct such value.
Sized | |
|
Instances
Generic (Sized a) Source # | |
Show a ⇒ Show (Sized a) Source # | |
DecCBOR a ⇒ DecCBOR (Sized a) Source # | |
EncCBOR a ⇒ EncCBOR (Sized a) Source # | Discards the size. |
NFData a ⇒ NFData (Sized a) Source # | |
Defined in Cardano.Ledger.Binary.Decoding.Sized | |
Eq a ⇒ Eq (Sized a) Source # | |
NoThunks a ⇒ NoThunks (Sized a) Source # | |
type Rep (Sized a) Source # | |
Defined in Cardano.Ledger.Binary.Decoding.Sized type Rep (Sized a) = D1 ('MetaData "Sized" "Cardano.Ledger.Binary.Decoding.Sized" "cardano-ledger-binary-1.3.2.0-inplace" 'False) (C1 ('MetaCons "Sized" 'PrefixI 'True) (S1 ('MetaSel ('Just "sizedValue") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "sizedSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64))) |
mkSized ∷ EncCBOR a ⇒ Version → a → Sized a Source #
Construct a Sized
value by serializing it first and recording the amount
of bytes it requires. Note, however, CBOR serialization is not canonical,
therefore it is *NOT* a requirement that this property holds:
sizedSize (mkSized a) === sizedSize (unsafeDeserialize (serialize a) :: a)
sizedDecoder ∷ Decoder s a → Decoder s (Sized a) Source #
Deprecated: In favor of more consistently named decodeSized