| 1 |
= EtaExpansion |
| 2 |
|
| 3 |
Eta expansion is a simple syntactic change used to work around the |
| 4 |
<<ValueRestriction#>> in <<StandardML#,Standard ML>>. |
| 5 |
|
| 6 |
The eta expansion of an expression `e` is the expression |
| 7 |
`fn z \=> e z`, where `z` does not occur in `e`. This only |
| 8 |
makes sense if `e` denotes a function, i.e. is of arrow type. Eta |
| 9 |
expansion delays the evaluation of `e` until the function is |
| 10 |
applied, and will re-evaluate `e` each time the function is |
| 11 |
applied. |
| 12 |
|
| 13 |
The name "eta expansion" comes from the eta-conversion rule of the |
| 14 |
<<LambdaCalculus#,lambda calculus>>. Expansion refers to the |
| 15 |
directionality of the equivalence being used, namely taking `e` to |
| 16 |
`fn z \=> e z` rather than `fn z \=> e z` to `e` (eta |
| 17 |
contraction). |