comparison src/list_util.sml @ 191:aa54250f58ac

Parametrized datatypes through explify
author Adam Chlipala <adamc@hcoop.net>
date Fri, 08 Aug 2008 10:28:32 -0400
parents 6230bdd122e7
children 73456bfde988
comparison
equal deleted inserted replaced
190:3eb53c957d10 191:aa54250f58ac
144 | h :: t => m (i + 1) (f (i, h) :: acc) t 144 | h :: t => m (i + 1) (f (i, h) :: acc) t
145 in 145 in
146 m 0 [] 146 m 0 []
147 end 147 end
148 148
149 fun foldli f =
150 let
151 fun m i acc ls =
152 case ls of
153 [] => acc
154 | h :: t => m (i + 1) (f (i, h, acc)) t
155 in
156 m 0
157 end
158
149 end 159 end