Skip to main content

Apply

Trait Apply 

Source
pub trait Apply<'a, A>: Functor<'a, A> {
    type Target<T>
       where T: 'a,
             A: 'a;

    // Required method
    fn apply<B>(
        self,
        f: <Self as Apply<'a, A>>::Target<ApplyFn<'a, A, B>>,
    ) -> <Self as Apply<'a, A>>::Target<B>
       where B: 'a;
}
Expand description

Apply takes an F<Fn(A) -> B> (or, rather, an F<ApplyFn<'a,A, B>> specifically) and applies it to an F<A> to produce an F<B>.

Required Associated Types§

Source

type Target<T> where T: 'a, A: 'a

Required Methods§

Source

fn apply<B>( self, f: <Self as Apply<'a, A>>::Target<ApplyFn<'a, A, B>>, ) -> <Self as Apply<'a, A>>::Target<B>
where B: 'a,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, A> Apply<'a, A> for Option<A>
where A: 'a,

Source§

type Target<T> = Option<T> where T: 'a

Source§

fn apply<B>( self, f: <Self as Apply<'a, A>>::Target<ApplyFn<'a, A, B>>, ) -> <Self as Apply<'a, A>>::Target<B>
where B: 'a,

Source§

impl<'a, A> Apply<'a, A> for Vec<A>
where A: 'a, Vec<A>: Clone,

Available on crate feature std only.
Source§

type Target<T> = Vec<T> where T: 'a

Source§

fn apply<B>( self, f: <Self as Apply<'a, A>>::Target<ApplyFn<'a, A, B>>, ) -> <Self as Apply<'a, A>>::Target<B>
where B: 'a,

Source§

impl<'a, A, E> Apply<'a, A> for Result<A, E>
where A: 'a,

Source§

type Target<T> = Result<T, E> where T: 'a

Source§

fn apply<B>( self, f: <Self as Apply<'a, A>>::Target<ApplyFn<'a, A, B>>, ) -> <Self as Apply<'a, A>>::Target<B>
where B: 'a,

Implementors§

Source§

impl<'a, A> Apply<'a, A> for Effect<'a, A>
where A: 'a,

Source§

type Target<T> = Effect<'a, T> where T: 'a

Source§

impl<'a, A: 'a, E: 'a> Apply<'a, A> for IO<'a, A, E>

Source§

type Target<T> = IO<'a, T, E> where T: 'a