diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-09-09 08:00:45 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-09-09 08:00:45 -0400 |
commit | 2b5e957c78d47ae6d66ee2f70435b827d1644a4f (patch) | |
tree | fc23a2be12e6d03e8be7f8754278784feaf45839 /src/mono_reduce.sml | |
parent | 9c09f789905d7b93b5f77084d76428d73bf5631a (diff) |
Don't replace <sc> in blob returns; optimize more 'option' pattern matches; detect more opportunities for 'let' inlining
Diffstat (limited to 'src/mono_reduce.sml')
-rw-r--r-- | src/mono_reduce.sml | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mono_reduce.sml b/src/mono_reduce.sml index 58dd2a23..c552db17 100644 --- a/src/mono_reduce.sml +++ b/src/mono_reduce.sml @@ -237,7 +237,9 @@ fun match (env, p : pat, e : exp) = end | (PNone _, ENone _) => Yes env + | (PNone _, ESome _) => No | (PSome (_, p), ESome (_, e)) => match (env, p, e) + | (PSome _, ENone _) => No | _ => Maybe @@ -543,7 +545,7 @@ fun reduce file = val effs_b = summarize 0 b (*val () = Print.prefaces "Try" - [("e", MonoPrint.p_exp env (e, ErrorMsg.dummySpan)), + [(*("e", MonoPrint.p_exp env (e, ErrorMsg.dummySpan)),*) ("e'", MonoPrint.p_exp env e'), ("e'_eff", p_events effs_e'), ("b", p_events effs_b)]*) @@ -574,8 +576,12 @@ fun reduce file = ("b", MonoPrint.p_exp (E.pushERel env x t NONE) b), ("effs_e'", Print.p_list p_event effs_e'), ("effs_b", Print.p_list p_event effs_b)];*) - if List.null effs_e' orelse (List.all (fn eff => eff <> Unsure) effs_e' - andalso verifyCompatible effs_b) then + if List.null effs_e' + orelse (List.all (fn eff => eff <> Unsure) effs_e' + andalso verifyCompatible effs_b) + orelse (case effs_b of + UseRel :: effs => List.all verifyUnused effs + | _ => false) then trySub () else e |