0

I recently have tried to understand what monad is.

Although I watched lots of posts and videos which explains what monad is and what category theory is, because it is too abstract I cant fully understand it. So

Can I have a useful example of monad??

user2864740
  • 57,407
  • 13
  • 129
  • 202
Notice
  • 537
  • 1
  • 7
  • 18

1 Answers1

1

I wrote this post as an example of using the monad abstraction purely as a practical way to avoid code duplication.

(Many things are Monads; what makes Monad useful is writing a function once (in terms of Monad) and then being able to reuse that same function with Future, Option, Either, Writer, State and so on).

lmm
  • 17,276
  • 3
  • 24
  • 37