let
foldi t ~init ~f = snd (
List
.fold_left t ~init:(0,init) ~f:(
fun
(i,a) c
->
(i+1,f i a c)))