summaryrefslogtreecommitdiff
path: root/src/elab_util.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/elab_util.sml')
-rw-r--r--src/elab_util.sml7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/elab_util.sml b/src/elab_util.sml
index 8082cb1e..e7985026 100644
--- a/src/elab_util.sml
+++ b/src/elab_util.sml
@@ -280,6 +280,13 @@ fun foldB {kind, con, bind} ctx st c =
S.Continue (_, st) => st
| S.Return _ => raise Fail "ElabUtil.Con.foldB: Impossible"
+fun fold {kind, con} st c =
+ case mapfoldB {kind = fn () => fn k => fn st => S.Continue (k, kind (k, st)),
+ con = fn () => fn c => fn st => S.Continue (c, con (c, st)),
+ bind = fn ((), _) => ()} () c st of
+ S.Continue (_, st) => st
+ | S.Return _ => raise Fail "ElabUtil.Con.fold: Impossible"
+
end
structure Exp = struct