Skip to content

Commit 3032546

Browse files
committed
Fix pattern matching snippets
1 parent c8e1896 commit 3032546

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/pattern-matching.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ type point = {
132132
133133
type t =
134134
| A((string, int))
135-
| B(r)
135+
| B(point)
136136
| C(array(int))
137-
| D(list(r));
137+
| D(list(point));
138138
139-
let x = D([{x: 2, y: 1.2}]);
139+
let x = D([{x: 2, y: 1}]);
140140
141141
switch (x) {
142142
| A(("hi", num)) => num
143-
| B({x, y: 1.2}) => x
143+
| B({x, y: 1}) => x
144144
| C([|x|]) => x
145145
| C([|2, 3, x|]) => x
146146
| D([]) => 2
@@ -156,8 +156,8 @@ switch (x) {
156156
```reason
157157
switch (x) {
158158
| 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)
159+
| B({x: _, y: 1} as r) => g(r)
160+
| D([{x: _, y: 1} as r, ..._]) => g(r)
161161
| _ => 42
162162
};
163163
```

0 commit comments

Comments
 (0)