diff src/mono_print.sml @ 1107:52571ca9b777

Eta-expand bodies of transaction functions in Monoization, to enable later optimization
author Adam Chlipala <adamc@hcoop.net>
date Thu, 31 Dec 2009 18:07:53 -0500
parents 72670131dace
children 7a31e0cf25e9
line wrap: on
line diff
--- a/src/mono_print.sml	Thu Dec 31 16:12:13 2009 -0500
+++ b/src/mono_print.sml	Thu Dec 31 18:07:53 2009 -0500
@@ -206,18 +206,26 @@
              string ".",
              string x]
 
-      | ECase (e, pes, _) => parenIf true (box [string "case",
-                                                space,
-                                                p_exp env e,
-                                                space,
-                                                string "of",
-                                                space,
-                                                p_list_sep (box [space, string "|", space])
-                                                           (fn (p, e) => box [p_pat env p,
-                                                                              space,
-                                                                              string "=>",
-                                                                              space,
-                                                                              p_exp (E.patBinds env p) e]) pes])
+      | ECase (e, pes, {result, ...}) => parenIf true (box [string "case",
+                                                            space,
+                                                            p_exp env e,
+                                                            space,
+                                                            if !debug then
+                                                                box [string "return",
+                                                                     space,
+                                                                     p_typ env result,
+                                                                     space]
+                                                            else
+                                                                box [],
+                                                            string "of",
+                                                            space,
+                                                            p_list_sep (box [space, string "|", space])
+                                                                       (fn (p, e) => box [p_pat env p,
+                                                                                          space,
+                                                                                          string "=>",
+                                                                                          space,
+                                                                                          p_exp (E.patBinds env p) e])
+                                                                       pes])
 
       | EError (e, t) => box [string "(error",
                               space,