pub trait Foldable<A> {
fn foldr<F, B>(self, folder: F, init: B) -> B
where
F: Fn(B, A) -> B;
fn fold_map<F, M>(self, f: F) -> M
where
Self: Sized,
F: Fn(A) -> M,
M: Monoid,
{ ... }
fn fold1<F>(self, folder: F) -> Option<A>
where
Self: Sized,
F: Fn(A, A) -> A,
{ ... }
fn null(self) -> bool
where
Self: Sized,
{ ... }
fn to_list(self) -> Vec<A>
where
Self: Sized,
{ ... }
fn length(self) -> usize
where
Self: Sized,
{ ... }
}
Expand description
One short general note here:
The implementations of some of the methods in this trait are not optimal performance wise!