| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusIR.Transform.RecInline
Description
Mutual recursion inlining.
Given a let rec group, this pass identifies helper bindings — those not
used by the body (non-roots), not self-recursive, and safe to inline according
to the same size/cost heuristics as the main inliner — and inlines them into
their callers.
This works across independent subgroups within the same let rec, e.g.
{even, odd, f, g} where {even, odd} and {f, g} are separate cycles.
No beta reduction is performed here; the resulting applications are left for downstream passes to clean up.
Synopsis
- recInline ∷ (ToBuiltinMeaning uni fun, MonadQuote m) ⇒ BuiltinsInfo uni fun → Bool → Term TyName Name uni fun a → m (Term TyName Name uni fun a)
- recInlinePass ∷ (Typecheckable uni fun, GEq uni, MonadQuote m, Ord a) ⇒ BuiltinsInfo uni fun → Bool → PirTCConfig uni fun → Pass m TyName Name uni fun a
- recInlinePassSC ∷ (Typecheckable uni fun, GEq uni, MonadQuote m, Ord a) ⇒ BuiltinsInfo uni fun → Bool → PirTCConfig uni fun → Pass m TyName Name uni fun a
Documentation
recInline ∷ (ToBuiltinMeaning uni fun, MonadQuote m) ⇒ BuiltinsInfo uni fun → Bool → Term TyName Name uni fun a → m (Term TyName Name uni fun a) Source #
Walk the term bottom-up, attempting to collapse each let rec group.
recInlinePass ∷ (Typecheckable uni fun, GEq uni, MonadQuote m, Ord a) ⇒ BuiltinsInfo uni fun → Bool → PirTCConfig uni fun → Pass m TyName Name uni fun a Source #
recInlinePassSC ∷ (Typecheckable uni fun, GEq uni, MonadQuote m, Ord a) ⇒ BuiltinsInfo uni fun → Bool → PirTCConfig uni fun → Pass m TyName Name uni fun a Source #