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

PlutusIR.Transform.RewriteRules

Synopsis

Documentation

rewriteWith ∷ (Monoid a, t ~ Term tyname Name uni fun a, HasUniques t, MonadQuote m) ⇒ RewriteRules uni fun → t → m t Source #

Rewrite a Term using the given RewriteRules (similar to functions of Term -> Term) Normally the rewrite rules are configured at entrypoint time of the compiler.

It goes without saying that the supplied rewrite rules must be type-preserving. MAYBE: enforce this with a `through typeCheckTerm`?

rewritePass ∷ ∀ m uni fun a. (Typecheckable uni fun, GEq uni, Ord a, MonadQuote m, Monoid a) ⇒ PirTCConfig uni fun → RewriteRules uni fun → Pass m TyName Name uni fun a Source #

rewritePassSC ∷ ∀ m uni fun a. (Typecheckable uni fun, GEq uni, Ord a, MonadQuote m, Monoid a) ⇒ PirTCConfig uni fun → RewriteRules uni fun → Pass m TyName Name uni fun a Source #

data RewriteRules uni fun Source #

A bundle of composed RewriteRules, to be passed at entrypoint of the compiler.

Instances

Instances details
Monoid (RewriteRules uni fun) Source # 
Instance details

Defined in PlutusIR.Transform.RewriteRules.Internal

Methods

memptyRewriteRules uni fun Source #

mappendRewriteRules uni fun → RewriteRules uni fun → RewriteRules uni fun Source #

mconcat ∷ [RewriteRules uni fun] → RewriteRules uni fun Source #

Semigroup (RewriteRules uni fun) Source # 
Instance details

Defined in PlutusIR.Transform.RewriteRules.Internal

Methods

(<>)RewriteRules uni fun → RewriteRules uni fun → RewriteRules uni fun Source #

sconcatNonEmpty (RewriteRules uni fun) → RewriteRules uni fun Source #

stimesIntegral b ⇒ b → RewriteRules uni fun → RewriteRules uni fun Source #

Default (RewriteRules DefaultUni DefaultFun) Source # 
Instance details

Defined in PlutusIR.Transform.RewriteRules.Internal

unRewriteRulesRewriteRules uni fun → ∀ tyname m a. (MonadQuote m, Monoid a) ⇒ VarsInfo tyname Name uni a → Term tyname Name uni fun a → m (Term tyname Name uni fun a) Source #

defaultUniRewriteRulesRewriteRules DefaultUni DefaultFun Source #

The rules for the Default Universe/Builtin.