let fold_left f acc str = let racc = ref acc in for i = 0 to String.length str - 1 do racc := f !racc str.[i] done; !racc