From 76a84dd3fb97b56605292c4f0eab2febe3c6a7ed Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 31 Dec 2009 18:07:53 -0500 Subject: Eta-expand bodies of transaction functions in Monoization, to enable later optimization --- src/mono_print.sml | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'src/mono_print.sml') 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, -- cgit v1.2.3