diff options
Diffstat (limited to 'src/core_util.sml')
-rw-r--r-- | src/core_util.sml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/core_util.sml b/src/core_util.sml index 71efe16e..02cb86ca 100644 --- a/src/core_util.sml +++ b/src/core_util.sml @@ -900,6 +900,30 @@ fun foldMapB {kind, con, exp, decl, bind} ctx s d = S.Continue v => v | S.Return _ => raise Fail "CoreUtil.Decl.foldMapB: Impossible" +fun exists {kind, con, exp, decl} d = + case mapfold {kind = fn k => fn () => + if kind k then + S.Return () + else + S.Continue (k, ()), + con = fn c => fn () => + if con c then + S.Return () + else + S.Continue (c, ()), + exp = fn e => fn () => + if exp e then + S.Return () + else + S.Continue (e, ()), + decl = fn d => fn () => + if decl d then + S.Return () + else + S.Continue (d, ())} d () of + S.Return _ => true + | S.Continue _ => false + end structure File = struct |