Wed, 01 Nov 2006
Monads Made Easy (and Hard).
For some time I've been rather keen on learning the Haskell programming language. The big problem for me was that when I started out trying to solve particular problems I quickly ran into a strange catch-22. Haskell uses a concept called Monads but it seemed to me that in order to understand Haskell one needs to understand Monads and in order to understand Monads, one needs to understand Haskell.
There are however numerous tutorials and explanations on Monads. For instance:
- The Monadic Way.
- What are Monads.
- All about Monads.
- Monads as Containers.
- Crash Monad Tutorial.
- Monads for the Working Haskell Programmer.
- You Could have Invented Monads.
I've looked at many of these tutorials but never managed to get Monads. Its not that I can't understand difficult concepts or that I can't handle weird ass programming languages. The problem was that all these tutorials explained monads from the point of view of people who already understood Monads.
Anyway, my difficulty with Monads is at an end. I've just found an explanation of Monads called Of monads and spacesuits written by Eric Kow. It explains Monads using astronauts, space stations and space suits. I finally get it!
And now that I do, I can play with Monads in Ocaml and also go ahead and learn Haskell.
However, I will not be using Monads in C++ because the C++ implementation is just too damn weird. It makes a concept that can already be difficult even harder as well as making it unreadable. A pox on C++.
Posted at: 20:24 | Category: CodeHacking | Permalink