Trait grabbag::iter::FoldlIterator [] [src]

pub trait FoldlIterator<E>: Iterator<Item=E> + Sized {
    fn foldl<F: FnMut(E, E) -> E>(self, f: F) -> Option<E> { ... }
    fn foldl_map<E1, F: FnMut(E1, E) -> E1, MapFn: FnOnce(E) -> E1>(self, map: MapFn, f: F) -> Option<E1> { ... }
}

( a0, a1, a2, ... ),  →   →  ((a0) ⊗ a1) ⊗ a2) ⊗ ...

Provided Methods

fn foldl<F: FnMut(E, E) -> E>(self, f: F) -> Option<E>

Folds the elements of the iterator together, from left to right, using f.

Returns None if the iterator is empty.

fn foldl_map<E1, F: FnMut(E1, E) -> E1, MapFn: FnOnce(E) -> E1>(self, map: MapFn, f: F) -> Option<E1>

Folds the elements of the iterator together, from left to right, using `f.

In addition, the first element is transformed using map before folding begins.

Returns None if the iterator is empty.

Implementors