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

PlutusIR.Pass

Synopsis

Documentation

data Condition tyname name uni fun a where Source #

A condition on a Term.

Constructors

Typechecks ∷ (Typecheckable uni fun, GEq uni) ⇒ PirTCConfig uni fun → Condition TyName Name uni fun a

The Term typechecks.

GloballyUniqueNames ∷ (HasUnique tyname TypeUnique, HasUnique name TermUnique, Ord a) ⇒ Condition tyname name uni fun a

The Term has globally unique names.

Custom ∷ (Term tyname name uni fun a → Maybe (a, Text)) → Condition tyname name uni fun a

A custom condition. Nothing indicates success, Just indicates a failure at a location with a message.

data BiCondition tyname name uni fun a where Source #

A condition on a pair of Terms.

Constructors

ConstConditionCondition tyname name uni fun a → BiCondition tyname name uni fun a

A condition on the second Term.

CustomBi ∷ (Term tyname name uni fun a → Term tyname name uni fun a → Maybe (a, Text)) → BiCondition tyname name uni fun a

A custom condition. Nothing indicates success, Just indicates a failure at a location with a message.

checkConditionMonadError (Error uni fun a) m ⇒ Condition tyname name uni fun a → Term tyname name uni fun a → m () Source #

checkBiConditionMonadError (Error uni fun a) m ⇒ BiCondition tyname name uni fun a → Term tyname name uni fun a → Term tyname name uni fun a → m () Source #

data Pass m tyname name uni fun a Source #

A pass over a term, with pre- and post-conditions.

Constructors

Pass (Term tyname name uni fun a → m (Term tyname name uni fun a)) [Condition tyname name uni fun a] [BiCondition tyname name uni fun a]

A basic pass. Has a function, which is the pass itself, a set of pre-conditions which are run on the input term, and a set of post-conditions which are run on the input and output terms (so can compare them).

CompoundPass (Pass m tyname name uni fun a) (Pass m tyname name uni fun a) 
NoOpPass 
NamedPass String (Pass m tyname name uni fun a) 

Instances

Instances details
Monoid (Pass m tyname name uni fun a) Source # 
Instance details

Defined in PlutusIR.Pass

Methods

memptyPass m tyname name uni fun a Source #

mappendPass m tyname name uni fun a → Pass m tyname name uni fun a → Pass m tyname name uni fun a Source #

mconcat ∷ [Pass m tyname name uni fun a] → Pass m tyname name uni fun a Source #

Semigroup (Pass m tyname name uni fun a) Source # 
Instance details

Defined in PlutusIR.Pass

Methods

(<>)Pass m tyname name uni fun a → Pass m tyname name uni fun a → Pass m tyname name uni fun a Source #

sconcatNonEmpty (Pass m tyname name uni fun a) → Pass m tyname name uni fun a Source #

stimesIntegral b ⇒ b → Pass m tyname name uni fun a → Pass m tyname name uni fun a Source #

hoistPass ∷ (∀ v. m v → n v) → Pass m tyname name uni fun a → Pass n tyname name uni fun a Source #

runPassMonad m ⇒ (String → m ()) → BoolPass m tyname name uni fun a → Term tyname name uni fun a → ExceptT (Error uni fun a) m (Term tyname name uni fun a) Source #

simplePass ∷ (Typecheckable uni fun, GEq uni, Applicative m) ⇒ StringPirTCConfig uni fun → (Term TyName Name uni fun a → Term TyName Name uni fun a) → Pass m TyName Name uni fun a Source #

A simple, non-monadic pass that should typecheck.

renamePass ∷ (HasUnique name TermUnique, HasUnique tyname TypeUnique, MonadQuote m, Ord a) ⇒ Pass m tyname name uni fun a Source #

A pass that does renaming.

typecheckPass ∷ (MonadTypeCheckPir err uni fun a m, Ord a) ⇒ PirTCConfig uni fun → Pass m TyName Name uni fun a Source #

A pass that does typechecking, useful when you want to do it explicitly and not as part of a precondition check.