diff src/core_util.sml @ 488:5521bb0b4014

Get preliminary ThreadedBlog working
author Adam Chlipala <adamc@hcoop.net>
date Tue, 11 Nov 2008 15:12:24 -0500
parents 685b41e85634
children ae03d09043c1
line wrap: on
line diff
--- a/src/core_util.sml	Tue Nov 11 11:49:51 2008 -0500
+++ b/src/core_util.sml	Tue Nov 11 15:12:24 2008 -0500
@@ -763,6 +763,14 @@
         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