| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusIR.Transform.CaseOfCase
Synopsis
- caseOfCase :: forall m tyname uni fun a. (MonadQuote m) => BuiltinsInfo uni fun -> Bool -> a -> Term tyname Name uni fun a -> m (Term tyname Name uni fun a) #
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 :: forall m uni fun a. (MonadQuote m, Ord a) => PirTCConfig uni fun -> BuiltinsInfo uni fun -> Bool -> a -> Pass m TyName Name uni fun a #