summaryrefslogtreecommitdiff
path: root/src/list_util.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-06-13 14:29:36 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-06-13 14:29:36 -0400
commitba3e01e524907d85f5cba6af62083fcdee606f33 (patch)
tree1f400f83f20ef1f54d68e1e7b674a08f29abb4d4 /src/list_util.sml
parentb7de8e9ac590f9d06df72d22489375b33a6efef9 (diff)
<dyn> inside <table>; fix Specialize bug with datatype decls generating other mutually-recursive datatype decls
Diffstat (limited to 'src/list_util.sml')
-rw-r--r--src/list_util.sml13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/list_util.sml b/src/list_util.sml
index bafac51b..1f6b24ee 100644
--- a/src/list_util.sml
+++ b/src/list_util.sml
@@ -123,6 +123,19 @@ fun foldlMapPartial f s =
fm ([], s)
end
+fun foldlMapAbort f s =
+ let
+ fun fm (ls', s) ls =
+ case ls of
+ nil => SOME (rev ls', s)
+ | h :: t =>
+ case f (h, s) of
+ NONE => NONE
+ | SOME (h', s') => fm (h' :: ls', s') t
+ in
+ fm ([], s)
+ end
+
fun search f =
let
fun s ls =