summaryrefslogtreecommitdiff
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
commitf94091da4205dc783cb4d452b935c3f20284278d (patch)
tree05f43354a940adfb7fb7ecb8300920d7e7fa604a
parentab9282b7359aa50b6c2f094e3cd8571ffa2dc3ac (diff)
Narrow Maybe match case.
-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