diff options
author | 2010-03-16 10:09:01 -0400 | |
---|---|---|
committer | 2010-03-16 10:09:01 -0400 | |
commit | 8d25de5bfec9180f3a07b7f1897bea3fca11b2a9 (patch) | |
tree | 32012eb864854a36e74947956e1133ce84cd64a7 /src/core_util.sml | |
parent | c94b5c539cf1941b834fa9b66dba5979440e25fb (diff) |
Undo an Especialize change that turned out to be unecessary
Diffstat (limited to 'src/core_util.sml')
-rw-r--r-- | src/core_util.sml | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/core_util.sml b/src/core_util.sml index 599e1abc..247dd32e 100644 --- a/src/core_util.sml +++ b/src/core_util.sml @@ -1,4 +1,4 @@ -(* Copyright (c) 2008, Adam Chlipala +(* Copyright (c) 2008-2010, Adam Chlipala * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -375,6 +375,21 @@ fun exists {kind, con} k = S.Return _ => true | S.Continue _ => false +fun existsB {kind, con, bind} ctx c = + case mapfoldB {kind = fn ctx => fn k => fn () => + if kind (ctx, k) then + S.Return () + else + S.Continue (k, ()), + con = fn ctx => fn c => fn () => + if con (ctx, c) then + S.Return () + else + S.Continue (c, ()), + bind = bind} ctx c () of + S.Return _ => true + | S.Continue _ => false + fun foldMap {kind, con} s c = case mapfold {kind = fn k => fn s => S.Continue (kind (k, s)), con = fn c => fn s => S.Continue (con (c, s))} c s of |