Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SI-6054 don't use the defunct List.map2 in example

  • Loading branch information...
commit 3fb5acc2109e196b70cbaa0f11573955ffd671a8 1 parent 71e45e0
@adriaanm adriaanm authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 08-expressions.md
View
8 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
Please sign in to comment.
Something went wrong with that request. Please try again.