[][src]Trait funlib::Functor

pub trait Functor<B>: HKT<B> {
    fn fmap<F>(&self, f: F) -> Self::M
    where
        F: Fn(&Self::A) -> B
; }

Functor type class

Required methods

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

Functor map

Examples

use funlib::Functor;
let n = Some(1).fmap(|i| i * 4);
assert_eq!(Some(4), n);
Loading content...

Implementations on Foreign Types

impl<A, B> Functor<B> for Option<A>[src]

impl<A, B> Functor<B> for Box<A>[src]

impl<A, B> Functor<B> for Rc<A>[src]

impl<A, B> Functor<B> for Vec<A>[src]

Loading content...

Implementors

Loading content...