diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-03-13 11:19:09 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-03-13 11:19:09 -0700 |
commit | 3fb5acc2109e196b70cbaa0f11573955ffd671a8 (patch) | |
tree | a8147961f6e98c99e23530129d9825cc0639915b /08-expressions.md | |
parent | 71e45e0707887f83f287c8870324072e70da1248 (diff) | |
download | scala-3fb5acc2109e196b70cbaa0f11573955ffd671a8.tar.gz scala-3fb5acc2109e196b70cbaa0f11573955ffd671a8.tar.bz2 scala-3fb5acc2109e196b70cbaa0f11573955ffd671a8.zip |
SI-6054 don't use the defunct List.map2 in example
Diffstat (limited to '08-expressions.md')
-rw-r--r-- | 08-expressions.md | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/08-expressions.md b/08-expressions.md index e951350fb3..6e8e44051d 100644 --- a/08-expressions.md +++ b/08-expressions.md @@ -435,12 +435,14 @@ parameterlist `()`. ###### Example The method values in the left column are each equivalent to the [eta-expanded expressions](#eta-expansion) on the right. -| | | +| placeholder syntax | eta-expansion | |------------------------------ | --------------------------------------------| |`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)_` | `{ val eta1 = xs; val eta2 = ys; x => List.map2(eta1, eta2)(x) }` | +|`map2 _` | `(x1, x2) => (x3) => map2(x1, x2)(x3)` | +|`map2(xs, ys)_` | `{ val eta1 = xs; val eta2 = ys; x => map2(eta1, eta2)(x) }` | + +This assumes a method `def map2[A, B, C](xs: List[A], ys: List[B])(f: (A, B) => C): List[C]`. Note that a space is necessary between a method name and the trailing underscore |