Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
PlutusIR.Compiler.Types
Synopsis
- data AllowEscape
- data PirTCConfig uni fun = PirTCConfig {}
- pirConfigTCConfig ∷ ∀ uni fun uni fun. Lens (PirTCConfig uni fun) (PirTCConfig uni fun) (TypeCheckConfig uni fun) (TypeCheckConfig uni fun)
- pirConfigAllowEscape ∷ ∀ uni fun. Lens' (PirTCConfig uni fun) AllowEscape
- data DatatypeStyle
- newtype DatatypeCompilationOpts = DatatypeCompilationOpts {}
- dcoStyle ∷ Iso' DatatypeCompilationOpts DatatypeStyle
- defaultDatatypeCompilationOpts ∷ DatatypeCompilationOpts
- data CompilationOpts a = CompilationOpts {
- _coOptimize ∷ Bool
- _coTypecheck ∷ Bool
- _coPedantic ∷ Bool
- _coVerbose ∷ Bool
- _coDebug ∷ Bool
- _coDatatypes ∷ DatatypeCompilationOpts
- _coMaxSimplifierIterations ∷ Int
- _coDoSimplifierUnwrapCancel ∷ Bool
- _coDoSimplifierCaseReduce ∷ Bool
- _coDoSimplifierRewrite ∷ Bool
- _coDoSimplifierBeta ∷ Bool
- _coDoSimplifierInline ∷ Bool
- _coDoSimplifierKnownCon ∷ Bool
- _coDoSimplifierCaseOfCase ∷ Bool
- _coDoSimplifierEvaluateBuiltins ∷ Bool
- _coDoSimplifierStrictifyBindings ∷ Bool
- _coDoSimplifierRemoveDeadBindings ∷ Bool
- _coInlineHints ∷ InlineHints Name (Provenance a)
- _coInlineConstants ∷ Bool
- _coInlineFix ∷ Bool
- _coInlineCallsiteGrowth ∷ Size
- _coProfile ∷ Bool
- _coRelaxedFloatin ∷ Bool
- _coCaseOfCaseConservative ∷ Bool
- _coPreserveLogging ∷ Bool
- coVerbose ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coTypecheck ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coRelaxedFloatin ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coProfile ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coPreserveLogging ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coPedantic ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coOptimize ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coMaxSimplifierIterations ∷ ∀ a. Lens' (CompilationOpts a) Int
- coInlineHints ∷ ∀ a a. Lens (CompilationOpts a) (CompilationOpts a) (InlineHints Name (Provenance a)) (InlineHints Name (Provenance a))
- coInlineFix ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coInlineConstants ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coInlineCallsiteGrowth ∷ ∀ a. Lens' (CompilationOpts a) Size
- coDoSimplifierUnwrapCancel ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coDoSimplifierStrictifyBindings ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coDoSimplifierRewrite ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coDoSimplifierRemoveDeadBindings ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coDoSimplifierKnownCon ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coDoSimplifierInline ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coDoSimplifierEvaluateBuiltins ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coDoSimplifierCaseReduce ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coDoSimplifierCaseOfCase ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coDoSimplifierBeta ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coDebug ∷ ∀ a. Lens' (CompilationOpts a) Bool
- coDatatypes ∷ ∀ a. Lens' (CompilationOpts a) DatatypeCompilationOpts
- coCaseOfCaseConservative ∷ ∀ a. Lens' (CompilationOpts a) Bool
- defaultCompilationOpts ∷ CompilationOpts a
- data CompilationCtx uni fun a = CompilationCtx {
- _ccOpts ∷ CompilationOpts a
- _ccEnclosing ∷ Provenance a
- _ccTypeCheckConfig ∷ PirTCConfig uni fun
- _ccBuiltinsInfo ∷ BuiltinsInfo uni fun
- _ccBuiltinCostModel ∷ CostingPart uni fun
- _ccRewriteRules ∷ RewriteRules uni fun
- ccTypeCheckConfig ∷ ∀ uni fun a. Lens' (CompilationCtx uni fun a) (PirTCConfig uni fun)
- ccRewriteRules ∷ ∀ uni fun a. Lens' (CompilationCtx uni fun a) (RewriteRules uni fun)
- ccOpts ∷ ∀ uni fun a. Lens' (CompilationCtx uni fun a) (CompilationOpts a)
- ccEnclosing ∷ ∀ uni fun a. Lens' (CompilationCtx uni fun a) (Provenance a)
- ccBuiltinsInfo ∷ ∀ uni fun a. Lens' (CompilationCtx uni fun a) (BuiltinsInfo uni fun)
- ccBuiltinCostModel ∷ ∀ uni fun a. Lens' (CompilationCtx uni fun a) (CostingPart uni fun)
- toDefaultCompilationCtx ∷ (Default (BuiltinsInfo uni fun), Default (CostingPart uni fun), Default (RewriteRules uni fun)) ⇒ TypeCheckConfig uni fun → CompilationCtx uni fun a
- validateOpts ∷ Compiling m uni fun a ⇒ Version → m ()
- getEnclosing ∷ MonadReader (CompilationCtx uni fun a) m ⇒ m (Provenance a)
- withEnclosing ∷ MonadReader (CompilationCtx uni fun a) m ⇒ (Provenance a → Provenance a) → m b → m b
- runIf ∷ MonadReader (CompilationCtx uni fun a) m ⇒ m Bool → (b → m b) → b → m b
- runIfOpts ∷ MonadReader (CompilationCtx uni fun a) m ⇒ (b → m b) → b → m b
- type PLCProgram uni fun a = Program TyName Name uni fun (Provenance a)
- type PLCTerm uni fun a = Term TyName Name uni fun (Provenance a)
- type PLCType uni a = Type TyName uni (Provenance a)
- data PLCRecType uni fun a
- = PlainType (PLCType uni a)
- | RecursiveType (RecursiveType uni fun (Provenance a))
- getType ∷ PLCRecType uni fun a → PLCType uni a
- wrap ∷ Provenance a → PLCRecType uni fun a → [PLCType uni a] → PIRTerm uni fun a → PIRTerm uni fun a
- unwrap ∷ Provenance a → PLCRecType uni fun a → PIRTerm uni fun a → PIRTerm uni fun a
- type PIRTerm uni fun a = Term TyName Name uni fun (Provenance a)
- type PIRType uni a = Type TyName uni (Provenance a)
- type Compiling m uni fun a = (Monad m, MonadReader (CompilationCtx uni fun a) m, MonadError (Error uni fun (Provenance a)) m, MonadQuote m, Ord a, AnnInline a, Typecheckable uni fun, GEq uni, PrettyUni uni, Pretty fun, Pretty a)
- type TermDef tyname name uni fun a = Def (VarDecl tyname name uni a) (Term tyname name uni fun a)
- data SharedName
- toProgramName ∷ SharedName → Quote Name
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.
data PirTCConfig uni fun Source #
extending the plc typecheck config with AllowEscape
Constructors
PirTCConfig | |
Fields |
Instances
HasKindCheckConfig (PirTCConfig uni fun) Source # | |
Defined in PlutusIR.Compiler.Types Methods kindCheckConfig ∷ Lens' (PirTCConfig uni fun) KindCheckConfig Source # kccHandleNameMismatches ∷ Lens' (PirTCConfig uni fun) HandleNameMismatches Source # | |
HasTypeCheckConfig (PirTCConfig uni fun) uni fun Source # | |
Defined in PlutusIR.Compiler.Types Methods typeCheckConfig ∷ Lens' (PirTCConfig uni fun) (TypeCheckConfig uni fun) Source # tccKindCheckConfig ∷ Lens' (PirTCConfig uni fun) KindCheckConfig Source # tccBuiltinTypes ∷ Lens' (PirTCConfig uni fun) (BuiltinTypes uni fun) Source # |
pirConfigTCConfig ∷ ∀ uni fun uni fun. Lens (PirTCConfig uni fun) (PirTCConfig uni fun) (TypeCheckConfig uni fun) (TypeCheckConfig uni fun) Source #
pirConfigAllowEscape ∷ ∀ uni fun. Lens' (PirTCConfig uni fun) AllowEscape 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]
Constructors
ScottEncoding | |
SumsOfProducts |
Instances
Read DatatypeStyle Source # | |
Defined in PlutusIR.Compiler.Types | |
Show DatatypeStyle Source # | |
Defined in PlutusIR.Compiler.Types | |
Eq DatatypeStyle Source # | |
Defined in PlutusIR.Compiler.Types Methods (==) ∷ DatatypeStyle → DatatypeStyle → Bool Source # (/=) ∷ DatatypeStyle → DatatypeStyle → Bool Source # | |
Pretty DatatypeStyle Source # | |
Defined in PlutusIR.Compiler.Types |
newtype DatatypeCompilationOpts Source #
Constructors
DatatypeCompilationOpts | |
Fields |
Instances
Show DatatypeCompilationOpts Source # | |
Defined in PlutusIR.Compiler.Types |
data CompilationOpts a Source #
Constructors
CompilationOpts | |
Fields
|
Instances
Show (CompilationOpts a) Source # | |
Defined in PlutusIR.Compiler.Types |
coTypecheck ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coRelaxedFloatin ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coPreserveLogging ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coPedantic ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coOptimize ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coMaxSimplifierIterations ∷ ∀ a. Lens' (CompilationOpts a) Int Source #
coInlineHints ∷ ∀ a a. Lens (CompilationOpts a) (CompilationOpts a) (InlineHints Name (Provenance a)) (InlineHints Name (Provenance a)) Source #
coInlineFix ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coInlineConstants ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coInlineCallsiteGrowth ∷ ∀ a. Lens' (CompilationOpts a) Size Source #
coDoSimplifierUnwrapCancel ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coDoSimplifierStrictifyBindings ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coDoSimplifierRewrite ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coDoSimplifierRemoveDeadBindings ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coDoSimplifierKnownCon ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coDoSimplifierInline ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coDoSimplifierEvaluateBuiltins ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coDoSimplifierCaseReduce ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coDoSimplifierCaseOfCase ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coDoSimplifierBeta ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
coDatatypes ∷ ∀ a. Lens' (CompilationOpts a) DatatypeCompilationOpts Source #
coCaseOfCaseConservative ∷ ∀ a. Lens' (CompilationOpts a) Bool Source #
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 #
toDefaultCompilationCtx ∷ (Default (BuiltinsInfo uni fun), Default (CostingPart uni fun), Default (RewriteRules uni fun)) ⇒ TypeCheckConfig uni fun → CompilationCtx uni fun a Source #
validateOpts ∷ Compiling m uni fun a ⇒ Version → m () Source #
getEnclosing ∷ MonadReader (CompilationCtx uni fun a) m ⇒ m (Provenance a) Source #
withEnclosing ∷ MonadReader (CompilationCtx uni fun a) m ⇒ (Provenance a → Provenance a) → m b → m b Source #
runIf ∷ MonadReader (CompilationCtx uni fun a) m ⇒ m Bool → (b → m b) → b → m b Source #
runIfOpts ∷ MonadReader (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 #
data PLCRecType uni fun a Source #
A possibly recursive type.
Constructors
PlainType (PLCType uni a) | |
RecursiveType (RecursiveType uni fun (Provenance a)) |
getType ∷ PLCRecType uni fun a → PLCType uni a Source #
Get the actual type inside a PLCRecType
.
wrap ∷ Provenance 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.
unwrap ∷ Provenance a → PLCRecType uni fun a → PIRTerm uni fun a → PIRTerm uni fun a Source #
Unwrap a term appropriately for a possibly recursive type.
type Compiling m uni fun a = (Monad m, MonadReader (CompilationCtx uni fun a) m, MonadError (Error uni fun (Provenance a)) m, MonadQuote m, Ord a, AnnInline 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.
Constructors
FixpointCombinator Integer | |
FixBy |