Trait Applicative

Source
pub trait Applicative<U>: Functor<U> {
    // Required methods
    fn pure_(value: U) -> Self::T
       where Self: HKT<U, C = U>;
    fn seq<F>(&self, fs: <Self as HKT<F>>::T) -> <Self as HKT<U>>::T
       where F: Fn(&<Self as HKT<U>>::C) -> U,
             Self: HKT<F>;
}

Required Methods§

Source

fn pure_(value: U) -> Self::T
where Self: HKT<U, C = U>,

Source

fn seq<F>(&self, fs: <Self as HKT<F>>::T) -> <Self as HKT<U>>::T
where F: Fn(&<Self as HKT<U>>::C) -> U, Self: HKT<F>,

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.

Implementations on Foreign Types§

Source§

impl<T, U> Applicative<U> for Option<T>

Source§

fn pure_(value: U) -> Self::T

Source§

fn seq<F>(&self, fs: <Self as HKT<F>>::T) -> Option<U>
where F: Fn(&T) -> U,

Source§

impl<T, U> Applicative<U> for Box<T>

Source§

fn pure_(value: U) -> Self::T

Source§

fn seq<F>(&self, fs: <Self as HKT<F>>::T) -> Box<U>
where F: Fn(&<Self as HKT<U>>::C) -> U,

Source§

impl<T, U> Applicative<U> for Rc<T>

Source§

fn pure_(value: U) -> Self::T

Source§

fn seq<F>(&self, fs: <Self as HKT<F>>::T) -> Rc<U>
where F: Fn(&<Self as HKT<U>>::C) -> U,

Source§

impl<T, U> Applicative<U> for Arc<T>

Source§

fn pure_(value: U) -> Self::T

Source§

fn seq<F>(&self, fs: <Self as HKT<F>>::T) -> Arc<U>
where F: Fn(&<Self as HKT<U>>::C) -> U,

Source§

impl<T, U> Applicative<U> for Vec<T>

Source§

fn pure_(value: U) -> Self::T

Source§

fn seq<F>(&self, fs: <Self as HKT<F>>::T) -> Vec<U>
where F: Fn(&T) -> U,

Implementors§