1 2 3 4 5 6 7 8 9 10
pub fn fold_left<S, T, F>( f: F, init: S, v: Vec<T>, ) -> S where F: Fn(S, T) -> S, { v.into_iter().fold(init, f) }