plutus-core-1.0.0.1: Language library for Plutus Core
Safe HaskellNone
LanguageHaskell2010

PlutusCore.Flat

Description

Flat instances for Plutus Core types. Make sure to read the Note [Stable encoding of PLC] before touching anything in this file. Also see the Notes [Serialising unit annotations] and [Serialising Scripts] before using anything in this file.

Synopsis

Documentation

newtype AsSerialize a Source #

For deriving Flat instances via Serialize.

Constructors

AsSerialize 

Fields

Instances

Instances details
Serialise a => Serialise (AsSerialize a) Source # 
Instance details

Defined in PlutusCore.Flat

Methods

encode :: AsSerialize a -> Encoding

decode :: Decoder s (AsSerialize a)

encodeList :: [AsSerialize a] -> Encoding

decodeList :: Decoder s [AsSerialize a]

Serialise a => Flat (AsSerialize a) Source # 
Instance details

Defined in PlutusCore.Flat

Methods

encode :: AsSerialize a -> Encoding

decode :: Get (AsSerialize a)

size :: AsSerialize a -> NumBits -> NumBits

safeEncodeBits :: NumBits -> Word8 -> Encoding Source #

Orphan instances

Flat Data Source # 
Instance details

Methods

encode :: Data -> Encoding

decode :: Get Data

size :: Data -> NumBits -> NumBits

Flat Unique Source # 
Instance details

Methods

encode :: Unique -> Encoding

decode :: Get Unique

size :: Unique -> NumBits -> NumBits

Flat TyName Source # 
Instance details

Methods

encode :: TyName -> Encoding

decode :: Get TyName

size :: TyName -> NumBits -> NumBits

Flat Name Source # 
Instance details

Methods

encode :: Name -> Encoding

decode :: Get Name

size :: Name -> NumBits -> NumBits

Flat TyDeBruijn Source # 
Instance details

Methods

encode :: TyDeBruijn -> Encoding

decode :: Get TyDeBruijn

size :: TyDeBruijn -> NumBits -> NumBits

Flat NamedTyDeBruijn Source # 
Instance details

Methods

encode :: NamedTyDeBruijn -> Encoding

decode :: Get NamedTyDeBruijn

size :: NamedTyDeBruijn -> NumBits -> NumBits

Flat DeBruijn Source # 
Instance details

Methods

encode :: DeBruijn -> Encoding

decode :: Get DeBruijn

size :: DeBruijn -> NumBits -> NumBits

Flat FakeNamedDeBruijn Source # 
Instance details

Methods

encode :: FakeNamedDeBruijn -> Encoding

decode :: Get FakeNamedDeBruijn

size :: FakeNamedDeBruijn -> NumBits -> NumBits

Flat NamedDeBruijn Source # 
Instance details

Methods

encode :: NamedDeBruijn -> Encoding

decode :: Get NamedDeBruijn

size :: NamedDeBruijn -> NumBits -> NumBits

Flat Index Source # 
Instance details

Methods

encode :: Index -> Encoding

decode :: Get Index

size :: Index -> NumBits -> NumBits

Closed uni => Flat (SomeTypeIn uni) Source # 
Instance details

Methods

encode :: SomeTypeIn uni -> Encoding

decode :: Get (SomeTypeIn uni)

size :: SomeTypeIn uni -> NumBits -> NumBits

Flat ann => Flat (Version ann) Source # 
Instance details

Methods

encode :: Version ann -> Encoding

decode :: Get (Version ann)

size :: Version ann -> NumBits -> NumBits

Flat ann => Flat (Kind ann) Source # 
Instance details

Methods

encode :: Kind ann -> Encoding

decode :: Get (Kind ann)

size :: Kind ann -> NumBits -> NumBits

Flat (Binder TyName) Source # 
Instance details

Methods

encode :: Binder TyName -> Encoding

decode :: Get (Binder TyName)

size :: Binder TyName -> NumBits -> NumBits

Flat (Binder Name) Source # 
Instance details

Methods

encode :: Binder Name -> Encoding

decode :: Get (Binder Name)

size :: Binder Name -> NumBits -> NumBits

Flat (Binder NamedTyDeBruijn) Source # 
Instance details

Methods

encode :: Binder NamedTyDeBruijn -> Encoding

decode :: Get (Binder NamedTyDeBruijn)

size :: Binder NamedTyDeBruijn -> NumBits -> NumBits

Flat (Binder DeBruijn) Source # 
Instance details

Methods

encode :: Binder DeBruijn -> Encoding

decode :: Get (Binder DeBruijn)

size :: Binder DeBruijn -> NumBits -> NumBits

Flat (Binder FakeNamedDeBruijn) Source # 
Instance details

Methods

encode :: Binder FakeNamedDeBruijn -> Encoding

decode :: Get (Binder FakeNamedDeBruijn)

size :: Binder FakeNamedDeBruijn -> NumBits -> NumBits

Flat (Binder NamedDeBruijn) Source # 
Instance details

Methods

encode :: Binder NamedDeBruijn -> Encoding

decode :: Get (Binder NamedDeBruijn)

size :: Binder NamedDeBruijn -> NumBits -> NumBits

Flat a => Flat (Normalized a) Source # 
Instance details

Methods

encode :: Normalized a -> Encoding

decode :: Get (Normalized a)

size :: Normalized a -> NumBits -> NumBits

(Closed uni, Everywhere uni Flat) => Flat (Some (ValueOf uni)) Source # 
Instance details

Methods

encode :: Some (ValueOf uni) -> Encoding

decode :: Get (Some (ValueOf uni))

size :: Some (ValueOf uni) -> NumBits -> NumBits

(Flat ann, Flat tyname) => Flat (TyVarDecl tyname ann) Source # 
Instance details

Methods

encode :: TyVarDecl tyname ann -> Encoding

decode :: Get (TyVarDecl tyname ann)

size :: TyVarDecl tyname ann -> NumBits -> NumBits

(Closed uni, Flat ann, Flat tyname) => Flat (Type tyname uni ann) Source # 
Instance details

Methods

encode :: Type tyname uni ann -> Encoding

decode :: Get (Type tyname uni ann)

size :: Type tyname uni ann -> NumBits -> NumBits

(Flat ann, Flat (Term tyname name uni fun ann)) => Flat (Program tyname name uni fun ann) Source # 
Instance details

Methods

encode :: Program tyname name uni fun ann -> Encoding

decode :: Get (Program tyname name uni fun ann)

size :: Program tyname name uni fun ann -> NumBits -> NumBits

(Closed uni, Everywhere uni Flat, Flat fun, Flat ann, Flat tyname, Flat name) => Flat (Term tyname name uni fun ann) Source # 
Instance details

Methods

encode :: Term tyname name uni fun ann -> Encoding

decode :: Get (Term tyname name uni fun ann)

size :: Term tyname name uni fun ann -> NumBits -> NumBits

(Closed uni, Flat fun, Flat ann, Flat tyname, Flat name) => Flat (VarDecl tyname name uni fun ann) Source # 
Instance details

Methods

encode :: VarDecl tyname name uni fun ann -> Encoding

decode :: Get (VarDecl tyname name uni fun ann)

size :: VarDecl tyname name uni fun ann -> NumBits -> NumBits