summaryrefslogtreecommitdiff
path: root/src/core_util.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/core_util.sml')
-rw-r--r--src/core_util.sml8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core_util.sml b/src/core_util.sml
index f7e92f51..38004f74 100644
--- a/src/core_util.sml
+++ b/src/core_util.sml
@@ -763,6 +763,14 @@ fun foldMap {kind, con, exp} s e =
S.Continue v => v
| S.Return _ => raise Fail "CoreUtil.Exp.foldMap: Impossible"
+fun foldMapB {kind, con, exp, bind} ctx s e =
+ case mapfoldB {kind = fn k => fn s => S.Continue (kind (k, s)),
+ con = fn ctx => fn c => fn s => S.Continue (con (ctx, c, s)),
+ exp = fn ctx => fn e => fn s => S.Continue (exp (ctx, e, s)),
+ bind = bind} ctx e s of
+ S.Continue v => v
+ | S.Return _ => raise Fail "CoreUtil.Exp.foldMapB: Impossible"
+
end
structure Decl = struct