diff src/list_util.sml @ 847:0f7e2cca6d9b

<dyn> inside <table>; fix Specialize bug with datatype decls generating other mutually-recursive datatype decls
author Adam Chlipala <adamc@hcoop.net>
date Sat, 13 Jun 2009 14:29:36 -0400
parents b2413e4dd109
children e571fb150a9f
line wrap: on
line diff
--- a/src/list_util.sml	Tue Jun 09 18:11:59 2009 -0400
+++ b/src/list_util.sml	Sat Jun 13 14:29:36 2009 -0400
@@ -123,6 +123,19 @@
         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 =