Trait Functor

Source
pub trait Functor {
    type Layer<X>;

    // Required method
    fn fmap<F, A, B>(input: Self::Layer<A>, f: F) -> Self::Layer<B>
       where F: FnMut(A) -> B;
}

Required Associated Types§

Source

type Layer<X>

Required Methods§

Source

fn fmap<F, A, B>(input: Self::Layer<A>, f: F) -> Self::Layer<B>
where F: FnMut(A) -> 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 Functor for Option<PartiallyApplied>

Source§

type Layer<X> = Option<X>

Source§

fn fmap<F, A, B>(input: Self::Layer<A>, f: F) -> Self::Layer<B>
where F: FnMut(A) -> B,

Source§

impl<Fst> Functor for (Fst, PartiallyApplied)

Source§

type Layer<X> = (Fst, X)

Source§

fn fmap<F, A, B>(input: Self::Layer<A>, f: F) -> Self::Layer<B>
where F: FnMut(A) -> B,

Implementors§

Source§

impl<F1: Functor, F2: Functor> Functor for Compose<F1, F2>

Source§

type Layer<X> = <F1 as Functor>::Layer<<F2 as Functor>::Layer<X>>