pub trait BifunctorOnce<F, A, B>where
    F: HKT2<T<A, B> = Self>,{
    // Required method
    fn bimap1<A2, B2, FA, FB>(self, fa: FA, fb: FB) -> F::T<A2, B2>
       where FA: F1Once<A, Ret = A2>,
             FB: F1Once<B, Ret = B2>;

    // Provided methods
    fn lmap1<A2, FA>(self, fa: FA) -> F::T<A2, B>
       where Self: Sized,
             FA: F1Once<A, Ret = A2> { ... }
    fn rmap1<B2, FB>(self, fb: FB) -> F::T<A, B2>
       where Self: Sized,
             FB: F1Once<B, Ret = B2> { ... }
}
Expand description

Bifunctor, but specialized to know at compile-time that the functions will only be called at most once.

Required Methods§

source

fn bimap1<A2, B2, FA, FB>(self, fa: FA, fb: FB) -> F::T<A2, B2>where FA: F1Once<A, Ret = A2>, FB: F1Once<B, Ret = B2>,

Provided Methods§

source

fn lmap1<A2, FA>(self, fa: FA) -> F::T<A2, B>where Self: Sized, FA: F1Once<A, Ret = A2>,

Map the left type in the Bifunctor

In Result, this maps the “Ok” type and is equivalent to map.

source

fn rmap1<B2, FB>(self, fb: FB) -> F::T<A, B2>where Self: Sized, FB: F1Once<B, Ret = B2>,

Map the right type in the Bifunctor

In Result, this maps the “Error” type and is equivalent to map_err.

Implementations on Foreign Types§

source§

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

source§

fn bimap1<AB, BB, FA, FB>(self, fa: FA, fb: FB) -> <Result as HKT2>::T<AB, BB>where FA: F1Once<A, Ret = AB>, FB: F1Once<E, Ret = BB>,

Implementors§