summaryrefslogtreecommitdiff
path: root/src/core_util.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-11-11 15:12:24 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-11-11 15:12:24 -0500
commitded9f1e15308a0ed27c9892d4b0285abc25654f8 (patch)
treed5ed1a7591b639cb85c0a2e8982c9d9929b42df3 /src/core_util.sml
parent5ca452a8576373895301be85a7dfc13746036cac (diff)
Get preliminary ThreadedBlog working
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