I’m new to functional programming. While following a tutorial on Monads, I got to think it as the analogy of Decorator pattern in OOP. Am I correct or is there any design pattern that closely resembles Monads ?
I’m new to functional programming. While following a tutorial on Monads, I got to
Share
Monads are definitely not decorators. There isn’t a standard OOP pattern in common use that is a direct analogy of monads. Though you can implement monads in OOP just fine, see e.g.:
The best Clojure-based monad tutorial I know of is this video series by Brian Marick:
I suggest watching this through – it’s a pretty good introduction with lots of examples.