Trait Monad

Source
pub trait Monad<'a, A>: Bind<'a, A> + Applicative<'a, A> { }
Expand description

A Monad is like a burrito, and also anything which implements Bind and Applicative.

A monad’s primary function is to provide the Bind trait, but to count as a monad a type must also implement Applicative, which in turn requires you to implement Functor, Pure and Apply.

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<'a, M, A> Monad<'a, A> for M
where M: Bind<'a, A> + Applicative<'a, A>,