aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core_util.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-10-30 16:58:54 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-10-30 16:58:54 -0400
commit0e88aba4fcbcf9587c289a555315ec30a112a2f0 (patch)
tree2b080558e197d010a6a3f570fb9aa138534d991a /src/core_util.sml
parentc6f6a629256d7292ae7c18428656eda4130391bd (diff)
Especialize
Diffstat (limited to 'src/core_util.sml')
-rw-r--r--src/core_util.sml7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core_util.sml b/src/core_util.sml
index 49182c09..df8465ae 100644
--- a/src/core_util.sml
+++ b/src/core_util.sml
@@ -578,6 +578,13 @@ fun exists {kind, con, exp} k =
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