let fold_lefti f init array = fst (Array.fold_left (fun (a,index) b -> f index a b, succ index) (init,0) array )