Trait Applicative

Source
pub trait Applicative: Functor + Lift {
    // Required method
    fn lift2<TIn1, TIn2, TOut, F>(
        f: F,
        x1: &<Self as WithTypeArg<TIn1>>::Type,
        x2: &<Self as WithTypeArg<TIn2>>::Type,
    ) -> <Self as WithTypeArg<TOut>>::Type
       where Self: WithTypeArg<TIn1> + WithTypeArg<TIn2> + WithTypeArg<TOut>,
             F: Fn(&TIn1, &TIn2) -> TOut;

    // Provided method
    fn ap<TIn, TOut, TFunc>(
        f: &<Self as WithTypeArg<TFunc>>::Type,
        x: &<Self as WithTypeArg<TIn>>::Type,
    ) -> <Self as WithTypeArg<TOut>>::Type
       where Self: WithTypeArg<TFunc> + WithTypeArg<TIn> + WithTypeArg<TOut>,
             TFunc: Fn(&TIn) -> TOut { ... }
}

Required Methods§

Source

fn lift2<TIn1, TIn2, TOut, F>( f: F, x1: &<Self as WithTypeArg<TIn1>>::Type, x2: &<Self as WithTypeArg<TIn2>>::Type, ) -> <Self as WithTypeArg<TOut>>::Type
where Self: WithTypeArg<TIn1> + WithTypeArg<TIn2> + WithTypeArg<TOut>, F: Fn(&TIn1, &TIn2) -> TOut,

Provided Methods§

Source

fn ap<TIn, TOut, TFunc>( f: &<Self as WithTypeArg<TFunc>>::Type, x: &<Self as WithTypeArg<TIn>>::Type, ) -> <Self as WithTypeArg<TOut>>::Type
where Self: WithTypeArg<TFunc> + WithTypeArg<TIn> + WithTypeArg<TOut>, TFunc: Fn(&TIn) -> TOut,

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.

Implementors§

Source§

impl Applicative for haskell_bits::impls::OptionTypeCon

Source§

impl Applicative for haskell_bits::impls::VecTypeCon

Source§

impl<E> Applicative for haskell_bits::impls::ResultTypeCon<E>
where E: Clone,