File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/Optimizations/GHC_opt Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 8
8
================
9
9
10
10
Lambda Lifting :cite:p: `lambdaLifting ` is a classic rewriting technique that
11
- that avoids excess closure allocations. It avoids closure allocation by moving
12
- local functions to the global scope of the program, and by adding parameters to
13
- the function definition to capture free variables. Thus, when a lifted function
14
- is called no heap allocation is needed because the lifted function no longer
15
- contains closures, rather it only references global names.
11
+ avoids excess closure allocations and removes free variables from a function. It
12
+ avoids closure allocation by moving local functions out of an enclosing function
13
+ to the :term: `top-level `. It then removes free variables by adding parameters to
14
+ the lifted function to capture free variables. This chapter describes the lambda
15
+ lifting transformation, describes how GHC implements the transformation and
16
+ provides guidance for when to implement the transformation manually.
16
17
17
18
A Working Example
18
19
-----------------
You can’t perform that action at this time.
0 commit comments