summaryrefslogtreecommitdiff
path: root/src/mono_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-12-31 18:07:53 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-12-31 18:07:53 -0500
commit76a84dd3fb97b56605292c4f0eab2febe3c6a7ed (patch)
tree0bde2b80fc3e8df14cd6e16f05bdd88e062aca9a /src/mono_print.sml
parentd57cc15e6b5c1f77ebfbfa222283809a4f594e36 (diff)
Eta-expand bodies of transaction functions in Monoization, to enable later optimization
Diffstat (limited to 'src/mono_print.sml')
-rw-r--r--src/mono_print.sml32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/mono_print.sml b/src/mono_print.sml
index d190640e..a5e795b2 100644
--- a/src/mono_print.sml
+++ b/src/mono_print.sml
@@ -206,18 +206,26 @@ fun p_exp' par env (e, _) =
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,