pub trait Bifunctor<A, B, C, D>: Bilift<A, B, C, D> {
// Required method
fn bimap<L, R>(
self,
left: L,
right: R,
) -> <Self as Bilift<A, B, C, D>>::Target
where L: Fn(A) -> C,
R: Fn(B) -> D;
}Expand description
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§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.