Trait Monad

Source
pub trait Monad: Applicative + Lift {
    // Required method
    fn bind<TIn, TOut, F>(
        x: &<Self as WithTypeArg<TIn>>::Type,
        f: F,
    ) -> <Self as WithTypeArg<TOut>>::Type
       where Self: WithTypeArg<TIn> + WithTypeArg<TOut>,
             F: Fn(&TIn) -> <Self as WithTypeArg<TOut>>::Type;

    // Provided methods
    fn bind_ignore<TIn, TOut>(
        x: &<Self as WithTypeArg<TIn>>::Type,
        y: &<Self as WithTypeArg<TOut>>::Type,
    ) -> <Self as WithTypeArg<TOut>>::Type
       where Self: WithTypeArg<TIn> + WithTypeArg<TOut>,
             <Self as WithTypeArg<TOut>>::Type: Clone { ... }
    fn fjoin<T>(
        x: &<Self as WithTypeArg<<Self as WithTypeArg<T>>::Type>>::Type,
    ) -> <Self as WithTypeArg<T>>::Type
       where Self: WithTypeArg<T> + WithTypeArg<<Self as WithTypeArg<T>>::Type>,
             <Self as WithTypeArg<T>>::Type: Clone { ... }
}

Required Methods§

Source

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

Provided Methods§

Source

fn bind_ignore<TIn, TOut>( x: &<Self as WithTypeArg<TIn>>::Type, y: &<Self as WithTypeArg<TOut>>::Type, ) -> <Self as WithTypeArg<TOut>>::Type
where Self: WithTypeArg<TIn> + WithTypeArg<TOut>, <Self as WithTypeArg<TOut>>::Type: Clone,

Source

fn fjoin<T>( x: &<Self as WithTypeArg<<Self as WithTypeArg<T>>::Type>>::Type, ) -> <Self as WithTypeArg<T>>::Type
where Self: WithTypeArg<T> + WithTypeArg<<Self as WithTypeArg<T>>::Type>, <Self as WithTypeArg<T>>::Type: Clone,

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 Monad for haskell_bits::impls::OptionTypeCon

Source§

impl Monad for haskell_bits::impls::VecTypeCon

Source§

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