Skip to main content

Functor

Trait Functor 

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

Required Methods§

Source

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

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<A, B> for Result<A, E>

Source§

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

Source§

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

Source§

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

Implementors§