pub trait Functor: HKT {
// Required method
fn fmap<A, B>(fa: Self::Of<A>, f: impl Fn(A) -> B) -> Self::Of<B>;
}Expand description
Covariant functor: lifts a function A -> B into F<A> -> F<B>.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Functor for IdentityF
impl Functor for NonEmptyVecF
Available on crate features
alloc or std only.impl Functor for OptionF
impl Functor for VecF
Available on crate features
alloc or std only.impl<E> Functor for EnvF<E>
impl<E> Functor for ResultF<E>
impl<F, G> Functor for ComposeF<F, G>
Functors compose: if F and G are both Functors, so is F . G.