[][src]Trait higher_cat::Bifunctor

pub trait Bifunctor<A, B, C, D>: Bilift<A, B, C, D> {
    fn bimap<L, R>(self, left: L, right: R) -> Self::Target
    where
        L: Fn(A) -> C,
        R: Fn(B) -> D
; }

A Bifunctor lets you change the types of a generic type with two type parameters.

A Bifunctor works just like a Functor, but for types with two type parameters. It will convert a F<_, _>: Bifunctor from F<A, B> to F<C, D> using two functions, one Fn(A) -> C and the other Fn(B) -> D.

Required methods

fn bimap<L, R>(self, left: L, right: R) -> Self::Target where
    L: Fn(A) -> C,
    R: Fn(B) -> D, 

Loading content...

Implementations on Foreign Types

impl<A, B, C, D> Bifunctor<A, B, C, D> for Result<A, B>[src]

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

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

Loading content...

Implementors

Loading content...