: Applicative (for pure/return, doesn't matter for this example) */ { // Self is like the "f a" in haskell /// extract the "a" from "f a" type Unplug; /// exchange the "a" in "f a" in the type of Self with B type Plug: Monad; fn bind<B, F>(self, f: F) -> Self::Plug where F: Fn(Self::Unplug) -> Self::Plug; } impl Monad for Option { type Unplug = A; type Plug = Option; fn bind<B, F>(self, f: F) -> Option where F: Fn(A) -