fn fold_map<T, Acc, U>( iter: impl Iterator<Item = T>, init: Acc, fun: impl FnMut(Acc, T) -> (Acc, U), ) -> (Acc, Vec<U>)