Skip to content

Commit efa233b

Browse files
author
doyougnu
committed
rewrite Lamda lifting introduction
1 parent c68bb7e commit efa233b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Optimizations/GHC_opt/lambda_lifting.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
================
99

1010
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.
1617

1718
A Working Example
1819
-----------------

0 commit comments

Comments
 (0)