plutus-core-1.34.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusIR.Compiler.Types

Synopsis

Documentation

data AllowEscape Source #

Extra flag to be passed in the TypeCheckM Reader context, to signal if the PIR expression currently being typechecked is at the top-level and thus its type can escape, or nested and thus not allowed to escape.

Constructors

YesEscape 
NoEscape 

data PirTCConfig uni fun Source #

extending the plc typecheck config with AllowEscape

pirConfigTCConfig ∷ ∀ uni fun uni fun. Lens (PirTCConfig uni fun) (PirTCConfig uni fun) (TypeCheckConfig uni fun) (TypeCheckConfig uni fun) Source #

data DatatypeStyle Source #

What style to use when encoding datatypes. Generally, SumsOfProducts is superior, unless you are targeting an old Plutus Core language version.

See Note [Encoding of datatypes]

data CompilationCtx uni fun a Source #

Constructors

CompilationCtx 

Fields

ccTypeCheckConfig ∷ ∀ uni fun a. Lens' (CompilationCtx uni fun a) (PirTCConfig uni fun) Source #

ccRewriteRules ∷ ∀ uni fun a. Lens' (CompilationCtx uni fun a) (RewriteRules uni fun) Source #

ccOpts ∷ ∀ uni fun a. Lens' (CompilationCtx uni fun a) (CompilationOpts a) Source #

ccEnclosing ∷ ∀ uni fun a. Lens' (CompilationCtx uni fun a) (Provenance a) Source #

ccBuiltinsInfo ∷ ∀ uni fun a. Lens' (CompilationCtx uni fun a) (BuiltinsInfo uni fun) Source #

ccBuiltinCostModel ∷ ∀ uni fun a. Lens' (CompilationCtx uni fun a) (CostingPart uni fun) Source #

validateOptsCompiling m e uni fun a ⇒ Version → m () Source #

withEnclosingMonadReader (CompilationCtx uni fun a) m ⇒ (Provenance a → Provenance a) → m b → m b Source #

runIfMonadReader (CompilationCtx uni fun a) m ⇒ m Bool → (b → m b) → b → m b Source #

runIfOptsMonadReader (CompilationCtx uni fun a) m ⇒ (b → m b) → b → m b Source #

type PLCProgram uni fun a = Program TyName Name uni fun (Provenance a) Source #

type PLCTerm uni fun a = Term TyName Name uni fun (Provenance a) Source #

type PLCType uni a = Type TyName uni (Provenance a) Source #

data PLCRecType uni fun a Source #

A possibly recursive type.

Constructors

PlainType (PLCType uni a) 
RecursiveType (RecursiveType uni fun (Provenance a)) 

getTypePLCRecType uni fun a → PLCType uni a Source #

Get the actual type inside a PLCRecType.

wrapProvenance a → PLCRecType uni fun a → [PLCType uni a] → PIRTerm uni fun a → PIRTerm uni fun a Source #

Wrap a term appropriately for a possibly recursive type.

unwrapProvenance a → PLCRecType uni fun a → PIRTerm uni fun a → PIRTerm uni fun a Source #

Unwrap a term appropriately for a possibly recursive type.

type PIRTerm uni fun a = Term TyName Name uni fun (Provenance a) Source #

type PIRType uni a = Type TyName uni (Provenance a) Source #

type Compiling m e uni fun a = (Monad m, MonadReader (CompilationCtx uni fun a) m, AsTypeError e (Term TyName Name uni fun ()) uni fun (Provenance a), AsTypeErrorExt e uni (Provenance a), AsError e uni fun (Provenance a), MonadError e m, MonadQuote m, Ord a, Typecheckable uni fun, GEq uni, PrettyUni uni, Pretty fun, Pretty a) Source #

type TermDef tyname name uni fun a = Def (VarDecl tyname name uni a) (Term tyname name uni fun a) Source #

data SharedName Source #

We generate some shared definitions compilation, this datatype defines the "keys" for those definitions.