4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="generator" content="AsciiDoc 8.6.9">
6 <title>EtaExpansion</title>
7 <link rel="stylesheet" href="./asciidoc.css" type="text/css">
8 <link rel="stylesheet" href="./pygments.css" type="text/css">
11 <script type="text/javascript" src="./asciidoc.js"></script>
12 <script type="text/javascript">
17 <link rel="stylesheet" href="./mlton.css" type="text/css">
19 <body class="article">
21 <div id="banner-home">
22 <a href="./Home">MLton 20180207</a>
30 <div class="sectionbody">
31 <div class="paragraph"><p>Eta expansion is a simple syntactic change used to work around the
32 <a href="ValueRestriction">ValueRestriction</a> in <a href="StandardML">Standard ML</a>.</p></div>
33 <div class="paragraph"><p>The eta expansion of an expression <span class="monospaced">e</span> is the expression
34 <span class="monospaced">fn z => e z</span>, where <span class="monospaced">z</span> does not occur in <span class="monospaced">e</span>. This only
35 makes sense if <span class="monospaced">e</span> denotes a function, i.e. is of arrow type. Eta
36 expansion delays the evaluation of <span class="monospaced">e</span> until the function is
37 applied, and will re-evaluate <span class="monospaced">e</span> each time the function is
39 <div class="paragraph"><p>The name "eta expansion" comes from the eta-conversion rule of the
40 <a href="LambdaCalculus">lambda calculus</a>. Expansion refers to the
41 directionality of the equivalence being used, namely taking <span class="monospaced">e</span> to
42 <span class="monospaced">fn z => e z</span> rather than <span class="monospaced">fn z => e z</span> to <span class="monospaced">e</span> (eta
43 contraction).</p></div>
47 <div id="footnotes"><hr></div>
49 <div id="footer-text">
51 <div id="footer-badges">