diff src/mono_util.sml @ 96:82aaa1c406d3

Mono optimizations (start with string concat and space eating)
author Adam Chlipala <adamc@hcoop.net>
date Thu, 03 Jul 2008 18:06:52 -0400
parents 40d146f467c5
children f0f59e918cac
line wrap: on
line diff
--- a/src/mono_util.sml	Thu Jul 03 17:53:28 2008 -0400
+++ b/src/mono_util.sml	Thu Jul 03 18:06:52 2008 -0400
@@ -266,6 +266,13 @@
         S.Continue (ds, ()) => ds
       | S.Return _ => raise Fail "MonoUtil.File.mapB: Impossible"
 
+fun map {typ, exp, decl} e =
+    case mapfold {typ = fn c => fn () => S.Continue (typ c, ()),
+                  exp = fn e => fn () => S.Continue (exp e, ()),
+                  decl = fn d => fn () => S.Continue (decl d, ())} e () of
+        S.Return () => raise Fail "Mono_util.File.map"
+      | S.Continue (e, ()) => e
+
 fun fold {typ, exp, decl} s d =
     case mapfold {typ = fn c => fn s => S.Continue (c, typ (c, s)),
                   exp = fn e => fn s => S.Continue (e, exp (e, s)),