Merge pull request #2821 from k4rtik/patch-1

[standard-ml/en] Redundancy is not permitted in pattern matching
This commit is contained in:
Pratik Karki 2017-08-25 15:00:36 +05:45 committed by GitHub
commit 4004e7b35d

View File

@ -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 *)