Trait naan::apply::Applicative

source ·
pub trait Applicative<F, A>where
    Self: Apply<F, A>,
    F: HKT1<T<A> = Self>,{
    // Required method
    fn pure(a: A) -> F::T<A>;

    // Provided method
    fn append_one(self, a: A) -> Self
       where Self: Sized + Semigroup { ... }
}
Expand description

Adds onto Apply the ability to lift a value to the F context.

Required Methods§

source

fn pure(a: A) -> F::T<A>

Lift A to F<A>

Provided Methods§

source

fn append_one(self, a: A) -> Selfwhere Self: Sized + Semigroup,

Append a single A to F<A>

Implementations on Foreign Types§

source§

impl<A> Applicative<Option, A> for Option<A>

source§

fn pure(a: A) -> Option<A>

source§

impl<A, E> Applicative<ResultOk<E>, A> for Result<A, E>

source§

fn pure(a: A) -> Result<A, E>

source§

impl<A, const N: usize> Applicative<ArrayVec<N>, A> for ArrayVec<[Option<A>; N]>

source§

fn pure(a: A) -> Self

source§

impl<A> Applicative<Vec, A> for Vec<A>

source§

fn pure(a: A) -> Vec<A>

Implementors§

source§

impl<T> Applicative<Id, T> for Id<T>