Permalink
Browse files
SI-6054 correct eta-expansion in method value using placeholder syntax
- Loading branch information...
Showing
with
3 additions
and
3 deletions.
-
+3
−3
08-expressions.md
|
@@ -433,21 +433,21 @@ parameterless method or call-by-name parameter of type |
|
|
parameterlist `()`.
|
|
|
|
|
|
###### Example
|
|
|
-The method values in the left column are each equivalent to the
|
|
|
-[anonymous functions](#anonymous-functions) on their right.
|
|
|
+The method values in the left column are each equivalent to the [eta-expanded expressions](#eta-expansion) on the right.
|
|
|
|
|
|
| | |
|
|
|
|------------------------------ | --------------------------------------------|
|
|
|
|`Math.sin _` | `x => Math.sin(x)` |
|
|
|
|`Array.range _` | `(x1, x2) => Array.range(x1, x2)` |
|
|
|
|`List.map2 _` | `(x1, x2) => (x3) => List.map2(x1, x2)(x3)` |
|
|
|
-|`List.map2(xs, ys)_` | `x => List.map2(xs, ys)(x)` |
|
|
|
+|`List.map2(xs, ys)_` | `{ val eta1 = xs; val eta2 = ys; x => List.map2(eta1, eta2)(x) }` |
|
|
|
|
|
|
|
|
|
Note that a space is necessary between a method name and the trailing underscore
|
|
|
because otherwise the underscore would be considered part of the name.
|
|
|
|
|
|
|
|
|
+
|
|
|
## Type Applications
|
|
|
|
|
|
```
|
|
|
0 comments on commit
51f3ac1