Functor

Trait Functor 

Source
pub trait Functor {
    type Elm;
    type M<B>;

    // Required method
    fn fmap<B, F>(self, f: F) -> Self::M<B>
       where F: Fn(&Self::Elm) -> B;
}

Required Associated Types§

Source

type Elm

Source

type M<B>

Required Methods§

Source

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> 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 f32

Source§

type Elm = f32

Source§

type M<U> = U

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> B,

Source§

impl Functor for f64

Source§

type Elm = f64

Source§

type M<U> = U

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> B,

Source§

impl Functor for i8

Source§

type Elm = i8

Source§

type M<U> = U

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> B,

Source§

impl Functor for i16

Source§

type Elm = i16

Source§

type M<U> = U

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> B,

Source§

impl Functor for i32

Source§

type Elm = i32

Source§

type M<U> = U

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> B,

Source§

impl Functor for i64

Source§

type Elm = i64

Source§

type M<U> = U

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> B,

Source§

impl Functor for i128

Source§

type Elm = i128

Source§

type M<U> = U

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> B,

Source§

impl Functor for isize

Source§

type Elm = isize

Source§

type M<U> = U

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> B,

Source§

impl Functor for u8

Source§

type Elm = u8

Source§

type M<U> = U

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> B,

Source§

impl Functor for u16

Source§

type Elm = u16

Source§

type M<U> = U

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> B,

Source§

impl Functor for u32

Source§

type Elm = u32

Source§

type M<U> = U

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> B,

Source§

impl Functor for u64

Source§

type Elm = u64

Source§

type M<U> = U

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> B,

Source§

impl Functor for u128

Source§

type Elm = u128

Source§

type M<U> = U

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> B,

Source§

impl Functor for usize

Source§

type Elm = usize

Source§

type M<U> = U

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> B,

Source§

impl<A> Functor for Option<A>

Source§

type Elm = A

Source§

type M<B> = Option<B>

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: FnOnce(&Self::Elm) -> B,

Source§

impl<A> Functor for Box<A>

Source§

type Elm = A

Source§

type M<U> = Box<U>

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: FnOnce(&Self::Elm) -> B,

Source§

impl<A> Functor for Rc<A>

Source§

type Elm = A

Source§

type M<U> = Rc<U>

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: FnOnce(&Self::Elm) -> B,

Source§

impl<A> Functor for Vec<A>

Source§

type Elm = A

Source§

type M<B> = Vec<B>

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: Fn(&Self::Elm) -> B,

Source§

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

Source§

type Elm = A

Source§

type M<B> = Result<B, E>

Source§

fn fmap<B, F>(self, f: F) -> Self::M<B>
where F: FnOnce(&Self::Elm) -> B,

Implementors§