diff src/core_util.sml @ 443:bd9ee9aeca2f

Especialize
author Adam Chlipala <adamc@hcoop.net>
date Thu, 30 Oct 2008 16:58:54 -0400
parents ab3177746c78
children dfc8c991abd0
line wrap: on
line diff
--- a/src/core_util.sml	Thu Oct 30 15:39:06 2008 -0400
+++ b/src/core_util.sml	Thu Oct 30 16:58:54 2008 -0400
@@ -578,6 +578,13 @@
         S.Return _ => true
       | S.Continue _ => false
 
+fun foldMap {kind, con, exp} s e =
+    case mapfold {kind = fn k => fn s => S.Continue (kind (k, s)),
+                  con = fn c => fn s => S.Continue (con (c, s)),
+                  exp = fn e => fn s => S.Continue (exp (e, s))} e s of
+        S.Continue v => v
+      | S.Return _ => raise Fail "CoreUtil.Exp.foldMap: Impossible"
+
 end
 
 structure Decl = struct