Trait garfield::applicative::Applicative
source · [−]pub trait Applicative: Functor {
fn pure(a: Self::Inner) -> Self::Wrapped<Self::Inner>;
fn seq<F: Fn(Self::Inner) -> B, B>(
f: F,
fa: Self::Wrapped<Self::Inner>
) -> Self::Wrapped<B>;
fn lift_a2<F: Fn(Self::Inner, B) -> C, B, C>(
f: F,
fa: Self::Wrapped<Self::Inner>,
fb: Self::Wrapped<B>
) -> Self::Wrapped<C>;
}
Expand description
A functor with application, providing operations to
- Embed pure expressions using
Applicative::pure
- Sequence computations and combine their results using
Applicative::lift_a2
Required Methods
sourcefn pure(a: Self::Inner) -> Self::Wrapped<Self::Inner>
fn pure(a: Self::Inner) -> Self::Wrapped<Self::Inner>
Lift a value into a functor
In Haskell speak this translates to, pure :: (Functor f) => a -> f a