shelley-spec-ledger-0.1.0.0
Safe HaskellNone
LanguageHaskell98

Shelley.Spec.Ledger.Serialization

Synopsis

Documentation

class Typeable a => ToCBORGroup a where Source #

Methods

toCBORGroup :: a -> Encoding Source #

encodedGroupSizeExpr :: (forall x. ToCBOR x => Proxy x -> Size) -> Proxy a -> Size Source #

listLen :: a -> Word Source #

listLenBound :: Proxy a -> Word Source #

an upper bound for listLen, used in Size expressions.

Instances

Instances details
ToCBORGroup ProtVer Source # 
Instance details

Defined in Shelley.Spec.Ledger.PParams

ToCBORGroup Ptr Source # 
Instance details

Defined in Shelley.Spec.Ledger.Credential

Crypto crypto => ToCBORGroup (OCert crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.OCert

Methods

toCBORGroup :: OCert crypto -> Encoding Source #

encodedGroupSizeExpr :: (forall x. ToCBOR x => Proxy x -> Size) -> Proxy (OCert crypto) -> Size Source #

listLen :: OCert crypto -> Word Source #

listLenBound :: Proxy (OCert crypto) -> Word Source #

Crypto crypto => ToCBORGroup (PoolParams crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.TxBody

Methods

toCBORGroup :: PoolParams crypto -> Encoding Source #

encodedGroupSizeExpr :: (forall x. ToCBOR x => Proxy x -> Size) -> Proxy (PoolParams crypto) -> Size Source #

listLen :: PoolParams crypto -> Word Source #

listLenBound :: Proxy (PoolParams crypto) -> Word Source #

Era era => ToCBORGroup (TxSeq era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.BlockChain

Methods

toCBORGroup :: TxSeq era -> Encoding Source #

encodedGroupSizeExpr :: (forall x. ToCBOR x => Proxy x -> Size) -> Proxy (TxSeq era) -> Size Source #

listLen :: TxSeq era -> Word Source #

listLenBound :: Proxy (TxSeq era) -> Word Source #

class Typeable a => FromCBORGroup a where Source #

Instances

Instances details
FromCBORGroup ProtVer Source # 
Instance details

Defined in Shelley.Spec.Ledger.PParams

FromCBORGroup Ptr Source # 
Instance details

Defined in Shelley.Spec.Ledger.Credential

Crypto crypto => FromCBORGroup (OCert crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.OCert

Methods

fromCBORGroup :: Decoder s (OCert crypto) Source #

Crypto crypto => FromCBORGroup (PoolParams crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.TxBody

Methods

fromCBORGroup :: Decoder s (PoolParams crypto) Source #

newtype CBORGroup a Source #

Constructors

CBORGroup 

Fields

Instances

Instances details
ToCBORGroup a => ToCBOR (CBORGroup a) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Serialization

Methods

toCBOR :: CBORGroup a -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (CBORGroup a) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [CBORGroup a] -> Size Source #

(FromCBORGroup a, ToCBORGroup a) => FromCBOR (CBORGroup a) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Serialization

newtype CborSeq a Source #

Constructors

CborSeq 

Fields

Instances

Instances details
Foldable CborSeq Source # 
Instance details

Defined in Shelley.Spec.Ledger.Serialization

Methods

fold :: Monoid m => CborSeq m -> m #

foldMap :: Monoid m => (a -> m) -> CborSeq a -> m #

foldMap' :: Monoid m => (a -> m) -> CborSeq a -> m #

foldr :: (a -> b -> b) -> b -> CborSeq a -> b #

foldr' :: (a -> b -> b) -> b -> CborSeq a -> b #

foldl :: (b -> a -> b) -> b -> CborSeq a -> b #

foldl' :: (b -> a -> b) -> b -> CborSeq a -> b #

foldr1 :: (a -> a -> a) -> CborSeq a -> a #

foldl1 :: (a -> a -> a) -> CborSeq a -> a #

toList :: CborSeq a -> [a] #

null :: CborSeq a -> Bool #

length :: CborSeq a -> Int #

elem :: Eq a => a -> CborSeq a -> Bool #

maximum :: Ord a => CborSeq a -> a #

minimum :: Ord a => CborSeq a -> a #

sum :: Num a => CborSeq a -> a #

product :: Num a => CborSeq a -> a #

ToCBOR a => ToCBOR (CborSeq a) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Serialization

Methods

toCBOR :: CborSeq a -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (CborSeq a) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [CborSeq a] -> Size Source #

FromCBOR a => FromCBOR (CborSeq a) Source # 
Instance details

Defined in Shelley.Spec.Ledger.Serialization

decodeSet :: Ord a => Decoder s a -> Decoder s (Set a) Source #

decodeMap :: Ord a => Decoder s a -> Decoder s b -> Decoder s (Map a b) Source #

decodeMapTraverse :: (Ord a, Applicative t) => Decoder s (t a) -> Decoder s (t b) -> Decoder s (t (Map a b)) Source #

decodeRecordNamed :: Text -> (a -> Int) -> Decoder s a -> Decoder s a Source #

encodeMap :: (a -> Encoding) -> (b -> Encoding) -> Map a b -> Encoding Source #

groupRecord :: forall a s. (ToCBORGroup a, FromCBORGroup a) => Decoder s a Source #

mapToCBOR :: (ToCBOR a, ToCBOR b) => Map a b -> Encoding Source #

runByteBuilder :: Int -> Builder -> ByteString Source #

Run a ByteString Builder using a strategy aimed at making smaller things efficiently.

It takes a size hint and produces a strict ByteString. This will be fast when the size hint is the same or slightly bigger than the true size.