pub trait Pure<'a, B>where Self: Functor<'a, B>, B: 'a,{ // Required method fn pure(b: B) -> Self::Mapped; }
A Functor that provides a pure operation to wrap a single inner value
Functor
pure
Use this trait to implement a monad’s “return” function.
use fmap::Pure; assert_eq!(Vec::<i32>::pure(6), vec![6]);
Wrap single value
This is also called “return” in the context of monads.