Trait kinder::lift::Monad [] [src]

pub trait Monad<A>: Higher<A> {
    fn lift(x: A) -> Self::C
    where
        Self: Higher<A, B = A>
; fn bind<F>(&self, _: F) -> Self::C
    where
        F: FnMut(&Self::B) -> Self::C
; }

monad trait, similar to Haskell's monad class requires two functions: lift (usually return but return is reserved): lifts an B to an A, i.e Option::return(2) = Some(2) bind: maps an A to an A i.e Some(2).bind(|x| Some(x+1)) = Some(3)

Required Methods

Implementors