Content deleted Content added
Line 66:
=== Higher-Order Functions ===
The following program fragment defines a [[higher-order function]] <code>twice</code> that when given a function <code>f</code> from <code>Int</code> to <code>Int</code> returns a
<syntaxhighlight lang="Scala">
Line 72:
</syntaxhighlight>
<syntaxhighlight lang="Scala">
</syntaxhighlight>
Here the call to <code>twice(x -> x + 1)</code> returns a function that will increment its argument two times. Consequently, the result of the entire expression is <code>0 + 1 + 1 = 2</code>.
=== Extensible Records ===
|