Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- rewriteWith ∷ (Monoid a, t ~ Term tyname Name uni fun a, HasUniques t, MonadQuote m) ⇒ RewriteRules uni fun → t → m t
- 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
- 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
- data RewriteRules uni fun
- unRewriteRules ∷ RewriteRules 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)
- defaultUniRewriteRules ∷ RewriteRules DefaultUni DefaultFun
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
Monoid (RewriteRules uni fun) Source # | |
Defined in PlutusIR.Transform.RewriteRules.Internal mempty ∷ RewriteRules uni fun Source # mappend ∷ RewriteRules uni fun → RewriteRules uni fun → RewriteRules uni fun Source # mconcat ∷ [RewriteRules uni fun] → RewriteRules uni fun Source # | |
Semigroup (RewriteRules uni fun) Source # | |
Defined in PlutusIR.Transform.RewriteRules.Internal (<>) ∷ RewriteRules uni fun → RewriteRules uni fun → RewriteRules uni fun Source # sconcat ∷ NonEmpty (RewriteRules uni fun) → RewriteRules uni fun Source # stimes ∷ Integral b ⇒ b → RewriteRules uni fun → RewriteRules uni fun Source # | |
Default (RewriteRules DefaultUni DefaultFun) Source # | |
unRewriteRules ∷ RewriteRules 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 #
defaultUniRewriteRules ∷ RewriteRules DefaultUni DefaultFun Source #
The rules for the Default Universe/Builtin.