From e5e7bbaaae9cde0981c77e488a29e730876964ba Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 16 Mar 2010 10:09:01 -0400 Subject: Undo an Especialize change that turned out to be unecessary --- src/core_util.sml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/core_util.sml') 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 -- cgit v1.2.3