Function fmap::applicative_fmap
source · pub fn applicative_fmap<'a, T, B, F>(
applicative: T,
f: F
) -> <T as Functor<'a, B>>::Mappedwhere
T: Applicative<'a, B>,
F: 'a + Send + FnMut(<T as Functor<'a, B>>::Inner) -> B,
Expand description
Generic implementation of Functor::fmap
for Applicative
functors
This generic implementation can be used to define Functor::fmap
based on
Applicative::apply
and Pure::pure
when the functor is applicative.
A more specific implementation might be more efficient though.