diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-07-03 18:06:52 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-07-03 18:06:52 -0400 |
commit | 8d4e252a0d4ac2c89805cd2785f79572cdfe7d82 (patch) | |
tree | b40a8f79d41cd6fe1faebbca7aa44489fbaf0d42 /src/mono_util.sml | |
parent | b11edd2101e896dd0482715686712b67f00d3099 (diff) |
Mono optimizations (start with string concat and space eating)
Diffstat (limited to 'src/mono_util.sml')
-rw-r--r-- | src/mono_util.sml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mono_util.sml b/src/mono_util.sml index 5309244a..54eb9be7 100644 --- a/src/mono_util.sml +++ b/src/mono_util.sml @@ -266,6 +266,13 @@ fun mapB {typ, exp, decl, bind} ctx ds = 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)), |