summaryrefslogtreecommitdiff
path: root/src/reduce.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-06-08 16:08:31 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-06-08 16:08:31 -0400
commitd52cd67621a27bbd27888c170c843fafb552658c (patch)
treeda9a0932b4510bfb29a492314912c4e4aa84b73b /src/reduce.sml
parent813e9aa4d196962f47c784aeedeaf1cddf54dc4f (diff)
Reducing known record projections
Diffstat (limited to 'src/reduce.sml')
-rw-r--r--src/reduce.sml6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/reduce.sml b/src/reduce.sml
index 7a5b7367..fd2d5b1a 100644
--- a/src/reduce.sml
+++ b/src/reduce.sml
@@ -144,6 +144,12 @@ fun exp env e =
| ECApp ((ECAbs (_, _, e1), loc), c) =>
#1 (reduceExp env (subConInExp (0, c) e1))
+ | EField ((ERecord xes, _), (CName x, _), _) =>
+ (case List.find (fn ((CName x', _), _) => x' = x
+ | _ => false) xes of
+ SOME (_, e) => #1 e
+ | NONE => e)
+
| _ => e
and reduceExp env = U.Exp.mapB {kind = kind, con = con, exp = exp, bind = bind} env