comparison 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
comparison
equal deleted inserted replaced
846:0d30e6338c65 847:0f7e2cca6d9b
121 end 121 end
122 in 122 in
123 fm ([], s) 123 fm ([], s)
124 end 124 end
125 125
126 fun foldlMapAbort f s =
127 let
128 fun fm (ls', s) ls =
129 case ls of
130 nil => SOME (rev ls', s)
131 | h :: t =>
132 case f (h, s) of
133 NONE => NONE
134 | SOME (h', s') => fm (h' :: ls', s') t
135 in
136 fm ([], s)
137 end
138
126 fun search f = 139 fun search f =
127 let 140 let
128 fun s ls = 141 fun s ls =
129 case ls of 142 case ls of
130 [] => NONE 143 [] => NONE