plutus-core-1.0.0.1: Language library for Plutus Core
Safe Haskell None
Language Haskell2010

PlutusIR.Compiler

Synopsis

Documentation

compileTerm :: Compiling m e uni fun a => Term TyName Name uni fun a -> m (PLCTerm uni fun a) Source #

compileToReadable :: ( Compiling m e uni fun a, b ~ Provenance a) => Term TyName Name uni fun a -> m ( Term TyName Name uni fun b) Source #

The 1st half of the PIR compiler pipeline up to floating/merging the lets. We stop momentarily here to give a chance to the tx-plugin to dump a "readable" version of pir (i.e. floated).

compileReadableToPlc :: ( Compiling m e uni fun a, b ~ Provenance a) => Term TyName Name uni fun b -> m (PLCTerm uni fun a) Source #

The 2nd half of the PIR compiler pipeline. Compiles a Term into a PLC Term, by removing/translating step-by-step the PIR's language constructs to PLC. Note: the result *does* have globally unique names.

data Error uni fun a Source #

Constructors

CompilationError a Text

A generic compilation error.

UnsupportedError a Text

An error relating specifically to an unsupported feature.

PLCError ( Error uni fun a)

An error from running some PLC function, lifted into this error type for convenience.

PLCTypeError ( TypeError ( Term TyName Name uni fun ()) uni fun a)
PIRTypeError ( TypeErrorExt uni a)

Instances

Instances details
( GShow uni, Closed uni, Everywhere uni PrettyConst , Pretty fun, Pretty ann) => PrettyBy PrettyConfigPlc ( Error uni fun ann) Source #
Instance details

Defined in PlutusIR.Error

(PrettyUni uni ann, Pretty fun) => Show ( Error uni fun ann) Source #
Instance details

Defined in PlutusIR.Error

(PrettyUni uni ann, Typeable uni, Typeable fun, Typeable ann, Pretty fun) => Exception ( Error uni fun ann) Source #
Instance details

Defined in PlutusIR.Error

( Pretty ann, Pretty fun, GShow uni, Closed uni, Everywhere uni PrettyConst ) => Pretty ( Error uni fun ann) Source #
Instance details

Defined in PlutusIR.Error

Methods

pretty :: Error uni fun ann -> Doc ann0 Source #

prettyList :: [ Error uni fun ann] -> Doc ann0 Source #

HasErrorCode ( Error _a _b _c) Source #
Instance details

Defined in PlutusIR.Error

AsFreeVariableError ( Error uni fun a) Source #
Instance details

Defined in PlutusIR.Error

AsTypeErrorExt ( Error uni fun a) uni a Source #
Instance details

Defined in PlutusIR.Error

AsError ( Error uni fun a) uni fun a Source #
Instance details

Defined in PlutusIR.Error

AsTypeError ( Error uni fun a) ( Term TyName Name uni fun ()) uni fun a Source #
Instance details

Defined in PlutusIR.Error

class AsTypeError r term uni fun ann | r -> term uni fun ann where Source #

Minimal complete definition

_TypeError

Instances

Instances details
AsTypeError ( Error uni fun ann) ( Term TyName Name uni fun ()) uni fun ann Source #
Instance details

Defined in PlutusCore.Error

AsTypeError ( Error uni fun a) ( Term TyName Name uni fun ()) uni fun a Source #
Instance details

Defined in PlutusIR.Error

AsTypeError ( TypeError term uni fun ann) term uni fun ann Source #
Instance details

Defined in PlutusCore.Error

data Provenance a Source #

Indicates where a value comes from.

This is either an original annotation or a pieces of context explaining how the term relates to a previous Provenance . We also provide NoProvenance for convenience.

The provenance should always be just the original annotation, if we have one. It should only be another kind of provenance if we're in the process of generating some term that doesn't correspond directly to a term in the original AST.

ccTypeCheckConfig :: forall uni fun a uni fun. Lens ( CompilationCtx uni fun a) ( CompilationCtx uni fun a) ( Maybe ( PirTCConfig uni fun)) ( Maybe ( PirTCConfig uni fun)) Source #

data PirTCConfig uni fun Source #

extending the plc typecheck config with AllowEscape

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.