plutus-core- Language library for Plutus Core
Safe HaskellSafe-Inferred



Implements a PIR-to-PIR transformation that makes all recursive term definitions compilable to PLC. See Note [Thunking recursions] for details.



thunkRecursions ∷ (ToBuiltinMeaning uni fun, HasUnique name TermUnique, HasUnique tyname TypeUnique) ⇒ BuiltinsInfo uni fun → Term tyname name uni fun a → Term tyname name uni fun a Source #

Thunk recursions to turn recusive values of non-function type into recursive values of function type, so we can compile them.

Note: this pass breaks global uniqueness!

thunkRecursionsPass ∷ (Typecheckable uni fun, GEq uni, Applicative m) ⇒ PirTCConfig uni fun → BuiltinsInfo uni fun → Pass m TyName Name uni fun a Source #