Trait Foldable

Source
pub trait Foldable<B>: HKT<B> + Sized {
    // Required methods
    fn reduce<F>(self, b: B, ba: F) -> B
       where F: Fn(B, &<Self as HKT<B>>::Current) -> B;
    fn reduce_right<F>(self, b: B, f: F) -> B
       where F: Fn(&<Self as HKT<B>>::Current, B) -> B;
}

Required Methods§

Source

fn reduce<F>(self, b: B, ba: F) -> B
where F: Fn(B, &<Self as HKT<B>>::Current) -> B,

Source

fn reduce_right<F>(self, b: B, f: F) -> B
where F: Fn(&<Self as HKT<B>>::Current, B) -> B,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<A, B> Foldable<B> for Vec<A>

Source§

fn reduce<F>(self, b: B, fa: F) -> B
where F: Fn(B, &A) -> B,

Source§

fn reduce_right<F>(self, b: B, fa: F) -> B
where F: Fn(&A, B) -> B,

Implementors§