Skip to main content

Functor

Trait Functor 

Source
pub trait Functor<B>: HKT<B> {
    // Required method
    fn fmap<F>(self, f: F) -> Self::Target
       where F: FnOnce(Self::Current) -> B;
}

Required Methods§

Source

fn fmap<F>(self, f: F) -> Self::Target
where F: FnOnce(Self::Current) -> B,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<A, B, E> Functor<B> for Result<A, E>

Source§

fn fmap<F>(self, f: F) -> Self::Target
where F: FnOnce(A) -> B,

Source§

impl<A, B> Functor<B> for Option<A>

Source§

fn fmap<F>(self, f: F) -> Self::Target
where F: FnOnce(A) -> B,

Implementors§