comparison src/list_util.sml @ 110:3739af9e727a

Starting with closure links
author Adam Chlipala <adamc@hcoop.net>
date Sun, 13 Jul 2008 11:43:57 -0400
parents 02f42e9a1825
children 6230bdd122e7
comparison
equal deleted inserted replaced
109:813e5a52063d 110:3739af9e727a
26 *) 26 *)
27 27
28 structure ListUtil :> LIST_UTIL = struct 28 structure ListUtil :> LIST_UTIL = struct
29 29
30 structure S = Search 30 structure S = Search
31
32 fun mapConcat f =
33 let
34 fun mc acc ls =
35 case ls of
36 [] => rev acc
37 | h :: t => mc (List.revAppend (f h, acc)) t
38 in
39 mc []
40 end
31 41
32 fun mapfold f = 42 fun mapfold f =
33 let 43 let
34 fun mf ls s = 44 fun mf ls s =
35 case ls of 45 case ls of