[][src]Function accumulator::util::divide_and_conquer

pub fn divide_and_conquer<F, T: Clone, E>(
    f: F,
    acc: T,
    xs: &[T]
) -> Result<T, E> where
    F: Fn(&T, &T) -> Result<T, E>, 

Folds over xs but in a divide-and-conquer fashion: Instead of F(F(F(F(acc, a), b), c), d)) this computes F(acc, F(F(a, b), F(c, d))).