What are all of the monad naming conventions?

倖福魔咒の 提交于 2019-12-03 23:40:45
  • runX m where m :: X a will run the X monad and return the "side effect" along with the monad result, a.

  • evalX m will run the computation and return the result, a.

  • execX m will run the computation and return the "side effect" but not the result.

  • The lifts come in various flavors that can be a bit too tricky for me to want to explain them in a SO answer. You should probably know lift and liftIO and be aware of / eventually seek out the other variants such as liftWith and liftBaseWith. See, for example, EZYang's posting on the topic.

  • appending a T after the monad name implies transformer. Appending an M after a function name implies it is monadic. Appending an _ implies the result is ignored.

  • All other suffixed letters mean "use hoogle".

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!