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
  • 60,010
  • 15
  • 145
  • 220
Scalalang2
  • 536
  • 1
  • 7
  • 19

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,386
  • 3
  • 26
  • 37