Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype TyName = TyName {}
- data Name = Name {}
- data VarDecl tyname name (uni ∷ Type → Type) ann = VarDecl {
- _varDeclAnn ∷ ann
- _varDeclName ∷ name
- _varDeclType ∷ Type tyname uni ann
- data TyVarDecl tyname ann = TyVarDecl {
- _tyVarDeclAnn ∷ ann
- _tyVarDeclName ∷ tyname
- _tyVarDeclKind ∷ Kind ann
- varDeclNameString ∷ VarDecl tyname Name uni a → String
- tyVarDeclNameString ∷ TyVarDecl TyName a → String
- data Kind ann
- data Type tyname (uni ∷ Type → Type) ann
- = TyVar ann tyname
- | TyFun ann (Type tyname uni ann) (Type tyname uni ann)
- | TyIFix ann (Type tyname uni ann) (Type tyname uni ann)
- | TyForall ann tyname (Kind ann) (Type tyname uni ann)
- | TyBuiltin ann (SomeTypeIn uni)
- | TyLam ann tyname (Kind ann) (Type tyname uni ann)
- | TyApp ann (Type tyname uni ann) (Type tyname uni ann)
- | TySOP ann [[Type tyname uni ann]]
- data Datatype tyname name uni a = Datatype a (TyVarDecl tyname a) [TyVarDecl tyname a] name [VarDecl tyname name uni a]
- datatypeNameString ∷ Datatype TyName name uni a → String
- data Recursivity
- data Strictness
- data Binding tyname name uni fun a
- = TermBind a Strictness (VarDecl tyname name uni a) (Term tyname name uni fun a)
- | TypeBind a (TyVarDecl tyname a) (Type tyname uni a)
- | DatatypeBind a (Datatype tyname name uni a)
- data Term tyname name uni fun a
- = Let a Recursivity (NonEmpty (Binding tyname name uni fun a)) (Term tyname name uni fun a)
- | Var a name
- | TyAbs a tyname (Kind a) (Term tyname name uni fun a)
- | LamAbs a name (Type tyname uni a) (Term tyname name uni fun a)
- | Apply a (Term tyname name uni fun a) (Term tyname name uni fun a)
- | Constant a (Some (ValueOf uni))
- | Builtin a fun
- | TyInst a (Term tyname name uni fun a) (Type tyname uni a)
- | Error a (Type tyname uni a)
- | IWrap a (Type tyname uni a) (Type tyname uni a) (Term tyname name uni fun a)
- | Unwrap a (Term tyname name uni fun a)
- | Constr a (Type tyname uni a) Word64 [Term tyname name uni fun a]
- | Case a (Type tyname uni a) (Term tyname name uni fun a) [Term tyname name uni fun a]
- data Program tyname name uni fun ann = Program {}
- data Version = Version {}
- applyProgram ∷ (MonadError ApplyProgramError m, Semigroup a) ⇒ Program tyname name uni fun a → Program tyname name uni fun a → m (Program tyname name uni fun a)
- termAnn ∷ Term tyname name uni fun a → a
- bindingAnn ∷ Binding tyname name uni fun a → a
- progAnn ∷ ∀ tyname name uni fun ann. Lens' (Program tyname name uni fun ann) ann
- progVer ∷ ∀ tyname name uni fun ann. Lens' (Program tyname name uni fun ann) Version
- progTerm ∷ ∀ tyname name uni fun ann tyname name uni fun. Lens (Program tyname name uni fun ann) (Program tyname name uni fun ann) (Term tyname name uni fun ann) (Term tyname name uni fun ann)
Documentation
We use a newtype
to enforce separation between names used for types and
those used for terms.
Instances
A Name
represents variables/names in Plutus Core.
Name | |
|
Instances
data VarDecl tyname name (uni ∷ Type → Type) ann Source #
A "variable declaration", i.e. a name and a type for a variable.
VarDecl | |
|
Instances
data TyVarDecl tyname ann Source #
A "type variable declaration", i.e. a name and a kind for a type variable.
TyVarDecl | |
|
Instances
Instances
Functor Kind | |
Lift ann ⇒ Lift (Kind ann ∷ Type) | |
Generic (Kind ann) | |
Show ann ⇒ Show (Kind ann) | |
NFData ann ⇒ NFData (Kind ann) | |
Defined in PlutusCore.Core.Type | |
Eq ann ⇒ Eq (Kind ann) | |
Hashable ann ⇒ Hashable (Kind ann) | |
type Rep (Kind ann) | |
Defined in PlutusCore.Core.Type type Rep (Kind ann) = D1 ('MetaData "Kind" "PlutusCore.Core.Type" "plutus-core-1.36.0.0-inplace" 'False) (C1 ('MetaCons "Type" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ann)) :+: C1 ('MetaCons "KindArrow" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ann) :*: (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Kind ann)) :*: S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Kind ann))))) | |
type HasUniques (Kind ann) | |
Defined in PlutusCore.Core.Type |
data Type tyname (uni ∷ Type → Type) ann Source #
A Kind
assigned to expressions.
TyVar ann tyname | Type variable |
TyFun ann (Type tyname uni ann) (Type tyname uni ann) | Function type |
TyIFix ann (Type tyname uni ann) (Type tyname uni ann) | Fix-point type, for constructing self-recursive types |
TyForall ann tyname (Kind ann) (Type tyname uni ann) | Polymorphic type |
TyBuiltin ann (SomeTypeIn uni) | Builtin type |
TyLam ann tyname (Kind ann) (Type tyname uni ann) | Type lambda |
TyApp ann (Type tyname uni ann) (Type tyname uni ann) | Type application |
TySOP ann [[Type tyname uni ann]] | Sum-of-products type |
Instances
data Datatype tyname name uni a Source #
Instances
data Recursivity Source #
Each multi-let-group has to be marked with its scoping:
* NonRec
: the identifiers introduced by this multi-let are only linearly-scoped,
i.e. an identifier cannot refer to itself or later-introduced identifiers of the group.
* Rec
: an identifiers introduced by this multi-let group can use all other multi-lets
of the same group (including itself), thus permitting (mutual) recursion.
Instances
data Strictness Source #
Instances
Generic Strictness Source # | |
Defined in PlutusIR.Core.Type from ∷ Strictness → Rep Strictness x Source # to ∷ Rep Strictness x → Strictness Source # | |
Show Strictness Source # | |
Defined in PlutusIR.Core.Type | |
Flat Strictness Source # | |
Defined in PlutusIR.Core.Instance.Flat | |
Eq Strictness Source # | |
Defined in PlutusIR.Core.Type (==) ∷ Strictness → Strictness → Bool Source # (/=) ∷ Strictness → Strictness → Bool Source # | |
PrettyBy (PrettyConfigClassic configName) Strictness Source # | |
Defined in PlutusIR.Core.Instance.Pretty prettyBy ∷ PrettyConfigClassic configName → Strictness → Doc ann Source # prettyListBy ∷ PrettyConfigClassic configName → [Strictness] → Doc ann Source # | |
type Rep Strictness Source # | |
data Binding tyname name uni fun a Source #
TermBind a Strictness (VarDecl tyname name uni a) (Term tyname name uni fun a) | |
TypeBind a (TyVarDecl tyname a) (Type tyname uni a) | |
DatatypeBind a (Datatype tyname name uni a) |
Instances
data Term tyname name uni fun a Source #
Let a Recursivity (NonEmpty (Binding tyname name uni fun a)) (Term tyname name uni fun a) | |
Var a name | |
TyAbs a tyname (Kind a) (Term tyname name uni fun a) | |
LamAbs a name (Type tyname uni a) (Term tyname name uni fun a) | |
Apply a (Term tyname name uni fun a) (Term tyname name uni fun a) | |
Constant a (Some (ValueOf uni)) | |
Builtin a fun | |
TyInst a (Term tyname name uni fun a) (Type tyname uni a) | |
Error a (Type tyname uni a) | |
IWrap a (Type tyname uni a) (Type tyname uni a) (Term tyname name uni fun a) | |
Unwrap a (Term tyname name uni fun a) | |
Constr a (Type tyname uni a) Word64 [Term tyname name uni fun a] | |
Case a (Type tyname uni a) (Term tyname name uni fun a) [Term tyname name uni fun a] |
Instances
data Program tyname name uni fun ann Source #
Instances
DefaultPrettyPlcStrategy (Program tyname name uni fun ann) ⇒ PrettyBy PrettyConfigPlc (Program tyname name uni fun ann) Source # | |
Defined in PlutusIR.Core.Instance.Pretty prettyBy ∷ PrettyConfigPlc → Program tyname name uni fun ann → Doc ann0 Source # prettyListBy ∷ PrettyConfigPlc → [Program tyname name uni fun ann] → Doc ann0 Source # | |
(PrettyClassicBy configName tyname, PrettyClassicBy configName name, PrettyUni uni, Pretty fun, Pretty ann) ⇒ PrettyBy (PrettyConfigClassic configName) (Program tyname name uni fun ann) Source # | |
Defined in PlutusIR.Core.Instance.Pretty prettyBy ∷ PrettyConfigClassic configName → Program tyname name uni fun ann → Doc ann0 Source # prettyListBy ∷ PrettyConfigClassic configName → [Program tyname name uni fun ann] → Doc ann0 Source # | |
(PrettyConstraints configName tyname name uni, Pretty fun) ⇒ PrettyBy (PrettyConfigReadable configName) (Program tyname name uni fun a) Source # | |
Defined in PlutusIR.Core.Instance.Pretty.Readable prettyBy ∷ PrettyConfigReadable configName → Program tyname name uni fun a → Doc ann Source # prettyListBy ∷ PrettyConfigReadable configName → [Program tyname name uni fun a] → Doc ann Source # | |
Functor (Program tyname name uni fun) Source # | |
(tyname ~ TyName, name ~ Name) ⇒ CollectScopeInfo (Program tyname name uni fun) Source # | |
Defined in PlutusIR.Core.Instance.Scoping collectScopeInfo ∷ Program tyname name uni fun NameAnn → ScopeErrorOrInfo Source # | |
(tyname ~ TyName, name ~ Name) ⇒ EstablishScoping (Program tyname name uni fun) Source # | |
Defined in PlutusIR.Core.Instance.Scoping | |
Generic (Program tyname name uni fun ann) Source # | |
(Show tyname, Show name, GShow uni, Everywhere uni Show, Show fun, Show ann, Closed uni) ⇒ Show (Program tyname name uni fun ann) Source # | |
(Closed uni, Everywhere uni Flat, Flat fun, Flat a, Flat tyname, Flat name) ⇒ Flat (Program tyname name uni fun a) Source # | |
HasUniques (Term tyname name uni fun ann) ⇒ Rename (Program tyname name uni fun ann) Source # | |
Defined in PlutusIR.Transform.Rename | |
(PrettyClassic tyname, PrettyClassic name, PrettyUni uni, Pretty fun, Pretty ann) ⇒ Pretty (Program tyname name uni fun ann) Source # | |
type Rep (Program tyname name uni fun ann) Source # | |
Defined in PlutusIR.Core.Type type Rep (Program tyname name uni fun ann) = D1 ('MetaData "Program" "PlutusIR.Core.Type" "plutus-core-1.36.0.0-inplace-plutus-ir" 'False) (C1 ('MetaCons "Program" 'PrefixI 'True) (S1 ('MetaSel ('Just "_progAnn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ann) :*: (S1 ('MetaSel ('Just "_progVer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Version) :*: S1 ('MetaSel ('Just "_progTerm") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term tyname name uni fun ann))))) | |
type HasUniques (Program tyname name uni fun ann) Source # | |
Defined in PlutusIR.Core.Type |
The version of Plutus Core used by this program.
The intention is to convey different levels of backwards compatibility for existing scripts: - Major version changes are backwards-incompatible - Minor version changes are backwards-compatible - Patch version changes should be entirely invisible (and we will likely not use this level)
The version used should be changed only when the language itself changes. For example, adding a new kind of term to the language would require a minor version bump; removing a kind of term would require a major version bump.
Similarly, changing the semantics of the language will require a version bump, typically a major one. This is the main reason why the version is actually tracked in the AST: we can have two language versions with identical ASTs but different semantics, so we need to track the version explicitly.
Compatibility is about compatibility for specific scripts, not about e.g. tools which consume scripts. Adding a new kind of term does not change how existing scripts behave, but does change what tools would need to do to process scripts.
Instances
Generic Version | |
Show Version | |
NFData Version | |
Defined in PlutusCore.Version | |
Eq Version | |
Ord Version | |
Defined in PlutusCore.Version | |
Hashable Version | |
Pretty Version | |
type Rep Version | |
Defined in PlutusCore.Version type Rep Version = D1 ('MetaData "Version" "PlutusCore.Version" "plutus-core-1.36.0.0-inplace" 'False) (C1 ('MetaCons "Version" 'PrefixI 'True) (S1 ('MetaSel ('Just "_versionMajor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: (S1 ('MetaSel ('Just "_versionMinor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: S1 ('MetaSel ('Just "_versionPatch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)))) |
applyProgram ∷ (MonadError ApplyProgramError m, Semigroup a) ⇒ Program tyname name uni fun a → Program tyname name uni fun a → m (Program tyname name uni fun a) Source #
Applies one program to another. Fails if the versions do not match and tries to merge annotations.
bindingAnn ∷ Binding tyname name uni fun a → a Source #