From 303254696417c90c6799e7883db23637152ef172 Mon Sep 17 00:00:00 2001 From: David Sancho Moreno Date: Fri, 3 Nov 2023 08:25:15 +0100 Subject: [PATCH] Fix pattern matching snippets --- docs/pattern-matching.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/pattern-matching.md b/docs/pattern-matching.md index 4d997d4423..2d5c7c4e71 100644 --- a/docs/pattern-matching.md +++ b/docs/pattern-matching.md @@ -132,15 +132,15 @@ type point = { type t = | A((string, int)) - | B(r) + | B(point) | C(array(int)) - | D(list(r)); + | D(list(point)); -let x = D([{x: 2, y: 1.2}]); +let x = D([{x: 2, y: 1}]); switch (x) { | A(("hi", num)) => num -| B({x, y: 1.2}) => x +| B({x, y: 1}) => x | C([|x|]) => x | C([|2, 3, x|]) => x | D([]) => 2 @@ -156,8 +156,8 @@ switch (x) { ```reason switch (x) { | A(("hi", num)) as v => f(v) -| B({x: _, y: 1.2} as r) => g(r) -| 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) | _ => 42 }; ```