Expand description
Normalize the structure of Let
and LetRec
operators in expressions.
Normalization happens in the context of “scopes”, corresponding to
- the expression’s root and 2. each instance of a
LetRec
AST node.
Within each scope,
- Each expression is normalized to have all
Let
nodes at the root of the expression, in order of identifier. - Each expression assigns a contiguous block of identifiers.
The transform may remove some Let
and Get
operators, and does not
introduce any new operators.
The module also publishes the function renumber_bindings
which can
be used to renumber bindings in an expression starting from a provided
IdGen
, which is used to prepare distinct expressions for inlining.
Modules§
- inlining 🔒
- let_
motion 🔒 - renumbering 🔒
- support 🔒
Structs§
- Normalize
Lets - Install replace certain
Get
operators with theirLet
value.
Functions§
- normalize_
lets - Normalize
Let
andLetRec
structure. - renumber_
bindings - Re-assign an identifier to each
Let
.