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

PlutusIR.Transform.CaseOfCase

Synopsis

Documentation

caseOfCase ∷ ∀ m tyname uni fun a. (Ord fun, HasUnique tyname TypeUnique, MonadQuote m) ⇒ BuiltinsInfo uni fun → Bool → a → Term tyname Name uni fun a → m (Term tyname Name uni fun a) Source #

Perform the case-of-case transformation. This pushes case expressions into the case branches of other case expressions, which can often yield optimization opportunities.

Example: @ case (case s of { C1 a -> x; C2 b -> y; }) of D1 -> w D2 -> z

  • ->

case s of C1 a -> case x of { D1 -> w; D2 -> z; } C2 b -> case y of { D1 -> w; D2 -> z; } @

caseOfCasePass ∷ ∀ m uni fun a. (Typecheckable uni fun, GEq uni, MonadQuote m, Ord a) ⇒ PirTCConfig uni fun → BuiltinsInfo uni fun → Bool → a → Pass m TyName Name uni fun a Source #

caseOfCasePassSC ∷ ∀ m uni fun a. (Typecheckable uni fun, GEq uni, MonadQuote m, Ord a) ⇒ PirTCConfig uni fun → BuiltinsInfo uni fun → Bool → a → Pass m TyName Name uni fun a Source #