Trait higher::Profunctor

source ·
pub trait Profunctor<'a, B, C> {
    type Target<T, U>;

    fn dimap<A, D, L, R>(self, left: L, right: R) -> Self::Target<A, D>
    where
        L: Fn(A) -> B + 'a,
        R: Fn(C) -> D + 'a
; fn lcmap<A, L>(self, left: L) -> Self::Target<A, C>
    where
        Self: Sized,
        C: 'a,
        L: Fn(A) -> B + 'a
, { ... } fn rmap<D, R>(self, right: R) -> Self::Target<B, D>
    where
        Self: Sized,
        B: 'a,
        R: Fn(C) -> D + 'a
, { ... } }
Expand description

A Profunctor is just a Bifunctor that is contravariant over its first argument and covariant over its second argument. What’s the problem?

Required Associated Types§

Required Methods§

Map a function over both arguments of the profunctor.

Provided Methods§

Map a function over the contravariant first argument only.

Map a function over the covariant second argument only.

Implementors§