let fold_lefti f a b = let len = length b in let rec iter acc i = if i < len then iter (f acc i (get b i)) (i+1) else acc in iter a 0