aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/mono_util.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-08-02 18:12:37 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2012-08-02 18:12:37 -0400
commita8ae5c1814db75525bf0ab199b0e5bd08c2c558a (patch)
tree212d4eb5fff81460457ee63a17c13dc26b79091b /src/mono_util.sml
parentfdc6c1310be60fbeb597400618473861f78676de (diff)
New NameJs phase, still needing some debugging
Diffstat (limited to 'src/mono_util.sml')
-rw-r--r--src/mono_util.sml7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mono_util.sml b/src/mono_util.sml
index 38016f85..58498996 100644
--- a/src/mono_util.sml
+++ b/src/mono_util.sml
@@ -639,6 +639,13 @@ fun map {typ, exp, decl} e =
S.Return () => raise Fail "MonoUtil.Decl.map: Impossible"
| S.Continue (e, ()) => e
+fun foldMap {typ, exp, decl} s d =
+ case mapfold {typ = fn c => fn s => S.Continue (typ (c, s)),
+ exp = fn e => fn s => S.Continue (exp (e, s)),
+ decl = fn d => fn s => S.Continue (decl (d, s))} d s of
+ S.Continue v => v
+ | S.Return _ => raise Fail "MonoUtil.Decl.foldMap: Impossible"
+
fun foldMapB {typ, exp, decl, bind} ctx s d =
case mapfoldB {typ = fn c => fn s => S.Continue (typ (c, s)),
exp = fn ctx => fn e => fn s => S.Continue (exp (ctx, e, s)),