diff src/mono_opt.sml @ 184:98c29e3986d3

Push write inside case
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 Aug 2008 16:53:13 -0400
parents c0ea24dcb86f
children 19ee24bffbc0
line wrap: on
line diff
--- a/src/mono_opt.sml	Sun Aug 03 13:30:27 2008 -0400
+++ b/src/mono_opt.sml	Sun Aug 03 16:53:13 2008 -0400
@@ -185,6 +185,13 @@
       | EWrite (EFfiApp ("Basis", "urlifyString", [e]), _) =>
         EFfiApp ("Basis", "urlifyString_w", [e])
 
+
+      | EWrite (ECase (discE, pes, {disc, ...}), loc) =>
+        optExp (ECase (discE,
+                       map (fn (p, e) => (p, (EWrite e, loc))) pes,
+                       {disc = disc,
+                        result = (TRecord [], loc)}), loc)
+
       | _ => e
 
 and optExp e = #1 (U.Exp.map {typ = typ, exp = exp} e)