comparison src/list_util.sml @ 120:6230bdd122e7

Passing an argument to a web function
author Adam Chlipala <adamc@hcoop.net>
date Sun, 13 Jul 2008 20:07:10 -0400
parents 3739af9e727a
children aa54250f58ac
comparison
equal deleted inserted replaced
119:7fdc146b2bc2 120:6230bdd122e7
134 | v => v 134 | v => v
135 in 135 in
136 s 136 s
137 end 137 end
138 138
139 fun mapi f =
140 let
141 fun m i acc ls =
142 case ls of
143 [] => rev acc
144 | h :: t => m (i + 1) (f (i, h) :: acc) t
145 in
146 m 0 []
147 end
148
139 end 149 end