summaryrefslogtreecommitdiff
path: root/src/mono_opt.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2010-03-02 16:00:48 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2010-03-02 16:00:48 -0500
commit46e60fb6904b05340446e12d4a88a090b19b85fa (patch)
tree35ff2e860464207021d5a23b6c819398e9d19a7c /src/mono_opt.sml
parent74e835c7db56fb5e716add3bb8fe19534b557282 (diff)
Tone down Reduce and compensate with a new push-lambda-inside-case rule in MonoOpt; expand more Basis synonyms in Monoize
Diffstat (limited to 'src/mono_opt.sml')
-rw-r--r--src/mono_opt.sml16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mono_opt.sml b/src/mono_opt.sml
index 5d81d24d..fb6ff264 100644
--- a/src/mono_opt.sml
+++ b/src/mono_opt.sml
@@ -348,6 +348,22 @@ fun exp e =
result = ran}), loc)
end
+ | ECase (discE, pes, {disc, result = (TFun (dom, ran), loc)}) =>
+ let
+ fun doBody (p, e) =
+ let
+ val pb = MonoEnv.patBindsN p
+ in
+ (EApp (MonoEnv.liftExpInExp pb e, (ERel pb, loc)), loc)
+ end
+ in
+ EAbs ("x", dom, ran,
+ (optExp (ECase (MonoEnv.liftExpInExp 0 discE,
+ map (fn (p, e) => (p, doBody (p, e))) pes,
+ {disc = disc,
+ result = ran}), loc), loc))
+ end
+
| EWrite (EQuery {exps, tables, state, query,
initial = (EPrim (Prim.String ""), _),
body = (EStrcat ((EPrim (Prim.String s), _),