We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8e1896 commit 3032546Copy full SHA for 3032546
docs/pattern-matching.md
@@ -132,15 +132,15 @@ type point = {
132
133
type t =
134
| A((string, int))
135
- | B(r)
+ | B(point)
136
| C(array(int))
137
- | D(list(r));
+ | D(list(point));
138
139
-let x = D([{x: 2, y: 1.2}]);
+let x = D([{x: 2, y: 1}]);
140
141
switch (x) {
142
| A(("hi", num)) => num
143
-| B({x, y: 1.2}) => x
+| B({x, y: 1}) => x
144
| C([|x|]) => x
145
| C([|2, 3, x|]) => x
146
| D([]) => 2
@@ -156,8 +156,8 @@ switch (x) {
156
```reason
157
158
| A(("hi", num)) as v => f(v)
159
-| B({x: _, y: 1.2} as r) => g(r)
160
-| D([{x: _, y: 1.2} as r, ..._]) => g(r)
+| B({x: _, y: 1} as r) => g(r)
+| D([{x: _, y: 1} as r, ..._]) => g(r)
161
| _ => 42
162
};
163
```
0 commit comments