summaryrefslogtreecommitdiff
path: root/src/mono_reduce.sml
diff options
context:
space:
mode:
authorGravatar Karn Kallio <kkallio@eka>2011-07-06 17:54:23 -0530
committerGravatar Karn Kallio <kkallio@eka>2011-07-06 17:54:23 -0530
commit27ed0d066ddb84c6b983b7b671ff951d4f86b99e (patch)
tree05f43354a940adfb7fb7ecb8300920d7e7fa604a /src/mono_reduce.sml
parent621c0f86d459d2e50a5c167e7c114697d6178914 (diff)
Narrow Maybe match case.
Diffstat (limited to 'src/mono_reduce.sml')
-rw-r--r--src/mono_reduce.sml13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mono_reduce.sml b/src/mono_reduce.sml
index 06075954..3507480e 100644
--- a/src/mono_reduce.sml
+++ b/src/mono_reduce.sml
@@ -204,15 +204,12 @@ fun match (env, p : pat, e : exp) =
else
No
- | (PCon (_, PConVar n1, NONE), ECon (_, PConVar n2, NONE)) =>
+ | (PCon (_, PConVar n1, po), ECon (_, PConVar n2, eo)) =>
if n1 = n2 then
- Yes env
- else
- No
-
- | (PCon (_, PConVar n1, SOME p), ECon (_, PConVar n2, SOME e)) =>
- if n1 = n2 then
- match (env, p, e)
+ case (po, eo) of
+ (NONE, NONE) => Yes env
+ | (SOME p, SOME e) => match (env, p, e)
+ | _ => Maybe
else
No