What is a monad?

前端 未结 30 1630
太阳男子
太阳男子 2020-11-30 13:39

Having briefly looked at Haskell recently, what would be a brief, succinct, practical explanation as to what a monad essentially is?

I have found most expla

30条回答
  •  长情又很酷
    2020-11-30 14:05

    What the world needs is another monad blog post, but I think this is useful in identifying existing monads in the wild.

    • monads are fractals

    Sierpinski triangle

    The above is a fractal called Sierpinski triangle, the only fractal I can remember to draw. Fractals are self-similar structure like the above triangle, in which the parts are similar to the whole (in this case exactly half the scale as parent triangle).

    Monads are fractals. Given a monadic data structure, its values can be composed to form another value of the data structure. This is why it's useful to programming, and this is why it occurrs in many situations.

提交回复
热议问题