How to detect a Monad?

后端 未结 4 1177
南旧
南旧 2021-02-13 03:32

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:14

    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.

提交回复
热议问题