Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- 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]
- 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)
- termSubterms ∷ Traversal' (Term tyname name uni fun a) (Term tyname name uni fun a)
- termSubtypes ∷ Traversal' (Term tyname name uni fun a) (Type tyname uni a)
- termBindings ∷ Traversal' (Term tyname name uni fun a) (Binding tyname name uni fun a)
- termAnn ∷ Term tyname name uni fun a → a
- bindingAnn ∷ Binding tyname name uni fun a → a
- 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]]
- typeSubtypes ∷ ∀ tyname (uni ∷ Type → Type) ann f. Applicative f ⇒ (Type tyname uni ann → f (Type tyname uni ann)) → Type tyname uni ann → f (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
- datatypeSubtypes ∷ Traversal' (Datatype tyname name uni a) (Type tyname uni a)
- data Kind ann
- 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)
- bindingSubterms ∷ Traversal' (Binding tyname name uni fun a) (Term tyname name uni fun a)
- bindingSubtypes ∷ Traversal' (Binding tyname name uni fun a) (Type tyname uni a)
- bindingIds ∷ (HasUnique tyname TypeUnique, HasUnique name TermUnique) ⇒ Traversal1' (Binding tyname name uni fun a) Unique
- data Program tyname name uni fun ann = Program {}
- 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)
- 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
AST
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
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) Source #
termSubterms ∷ Traversal' (Term tyname name uni fun a) (Term tyname name uni fun a) Source #
termSubtypes ∷ Traversal' (Term tyname name uni fun a) (Type tyname uni a) Source #
termBindings ∷ Traversal' (Term tyname name uni fun a) (Binding tyname name uni fun a) Source #
bindingAnn ∷ Binding tyname name uni fun a → a Source #
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
typeSubtypes ∷ ∀ tyname (uni ∷ Type → Type) ann f. Applicative f ⇒ (Type tyname uni ann → f (Type tyname uni ann)) → Type tyname uni ann → f (Type tyname uni ann) Source #
data Datatype tyname name uni a Source #
Instances
datatypeSubtypes ∷ Traversal' (Datatype tyname name uni a) (Type tyname uni a) Source #
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.39.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 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
bindingSubterms ∷ Traversal' (Binding tyname name uni fun a) (Term tyname name uni fun a) Source #
bindingSubtypes ∷ Traversal' (Binding tyname name uni fun a) (Type tyname uni a) Source #
bindingIds ∷ (HasUnique tyname TypeUnique, HasUnique name TermUnique) ⇒ Traversal1' (Binding tyname name uni fun a) Unique Source #
All the identifiers/names introduced by this binding In case of a datatype-binding it has multiple identifiers: the type, constructors, match function
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.39.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 |
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.
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 | |
|