[][src]Trait higher_cat::Functor

pub trait Functor<A, B>: Lift<A, B> {
    fn map<F>(self, f: F) -> Self::Target1
    where
        F: Fn(A) -> B
; }

A Functor lets you change the type parameter of a generic type.

A Functor defines a method map on a type F<_>: Functor which converts an F<A> to F<B> using a function Fn(A) -> B applied to the As inside it.

You can also use this just to modify the values inside your container value without changing their type, if the mapping function returns a value of the same type. This is called an "endofunctor."

Required methods

fn map<F>(self, f: F) -> Self::Target1 where
    F: Fn(A) -> B, 

Loading content...

Implementations on Foreign Types

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

impl<A, B, E> Functor<A, B> for Result<A, E>[src]

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

impl<A, B, S> Functor<A, B> for HashSet<A, S> where
    A: Hash + Eq,
    B: Hash + Eq,
    S: BuildHasher + Default
[src]

impl<A, B> Functor<A, B> for BTreeSet<A> where
    A: Ord,
    B: Ord
[src]

impl<A, B, C, D, S> Functor<(A, B), (C, D)> for HashMap<A, B, S> where
    A: Hash + Eq,
    B: Hash + Eq,
    C: Hash + Eq,
    D: Hash + Eq,
    S: BuildHasher + Default
[src]

impl<A, B, C, D> Functor<(A, B), (C, D)> for BTreeMap<A, B> where
    A: Ord,
    B: Ord,
    C: Ord,
    D: Ord
[src]

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

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

impl<A, B> Functor<A, B> for BinaryHeap<A> where
    A: Ord,
    B: Ord
[src]

Loading content...

Implementors

Loading content...