How to detect a Monad?

后端 未结 4 1169
遇见更好的自我
遇见更好的自我 2021-02-13 04:02

Many of us don\'t have a background on functional programming, and much less on category theory algebra. So let\'s suppose that we need and therefore create a generic type like<

4条回答
  •  有刺的猬
    2021-02-13 04:20

    In my experience, the easiest way to find out and simultaneously build an intuition for monads is to just try to implement return and (>>=) for your type and verify that they satisfy the monad laws.

提交回复
热议问题