Monad Explained in One Picture

Monad explained in one picture

The point of Monad is composability. In the green category, T -> Monad<U> and U -> Monad<R> are not composable. flatMap turns a function of type T -> Monad<U> into a function of type Monad<T> -> Monad<U>, so that in the blue category, they become composable.

原文地址:https://www.cnblogs.com/weidagang2046/p/monad-explained-in-one-picture.html