FP

monad

monad中最重要的两个方法就是map与chain。map操作内容返回同样的容器,chain则在原map的基础上提供了退出容器的功能

  1. map-like: methods that return back the same type of Monad
  2. chain-like: methods that either return a different kind of monad, or a non-monadic value; it may or may not “exit” the monad pattern, which I like to refer to as “unwrapping” the monad value