summaryrefslogtreecommitdiffhomepage
path: root/standard-ml.html.markdown
diff options
context:
space:
mode:
authorPratik Karki <predatoramigo@gmail.com>2017-08-25 15:00:36 +0545
committerGitHub <noreply@github.com>2017-08-25 15:00:36 +0545
commit4004e7b35d816e8b184fda68c98a0ab1df39f3fd (patch)
tree2c8e8f25875a153f75970a770fd034d27c07dfdb /standard-ml.html.markdown
parente43c15454850557b4a3826fbf9ed2e0fa428ee75 (diff)
parentadd335bd0bc51313dd6c86578c275898b69b6b55 (diff)
Merge pull request #2821 from k4rtik/patch-1
[standard-ml/en] Redundancy is not permitted in pattern matching
Diffstat (limited to 'standard-ml.html.markdown')
-rw-r--r--standard-ml.html.markdown5
1 files changed, 4 insertions, 1 deletions
diff --git a/standard-ml.html.markdown b/standard-ml.html.markdown
index fe0f6971..e1fe0d19 100644
--- a/standard-ml.html.markdown
+++ b/standard-ml.html.markdown
@@ -352,7 +352,10 @@ val _ = print (say(Red) ^ "\n")
fun say Red = "You are red!"
| say Green = "You are green!"
| say Blue = "You are blue!"
- | say _ = raise Fail "Unknown color"
+
+(* We did not include the match arm `say _ = raise Fail "Unknown color"`
+because after specifying all three colors, the pattern is exhaustive
+and redundancy is not permitted in pattern matching *)
(* Here is a binary tree datatype *)