[Haskell-cafe] Explaining monads
Derek Elkins
derek.a.elkins at gmail.com
Tue Aug 14 13:07:18 EDT 2007
On Tue, 2007-08-14 at 09:55 -0500, Lanny Ripple wrote:
> Having just gone through all the tutorials and things (again but
> this time I think it stuck) the Haskell community is on the wrong
> track as far as teaching Monads to new programmers.
>
> If I were teaching addition and multiplication to children I
> wouldn't start with, "We'll begin by defining an algebraic
> structure named a "Group". From there we'll expand our concept
> to a "Ring" and "Field". A group is a set and a binary operator
> usually named "+" (or sometimes "*") such that...".
>
> No no no. You start with, "You all know how to count from one to
> 10. If we have 1 item and we 'add' another 1 item we have 2
> items. We write this 1+1=2."
For every monad tutorial of the former type, I can find ten of the
latter. This is not the problem. A similar complaint is tutorials that
invoke category theory; almost none of them do this either.
What people need to do is stop reading two page blog posts by someone
who's "just got" monads and read the well-written peer-reviewed papers
by the people who clearly know what they are talking about. Luckily,
for monads applied to Haskell we have Wadler, a witty, enjoyable and
clear writer/speaker. All of Wadler's monad "introductions" are
readable by anyone with a basic grasp of Haskell. You certainly don't
need to be even remotely an academic to understand them. I'm willing to
bet that many people who say they don't understand monads and have read
"every tutorial about them" haven't read -any- of Wadler's papers.
More information about the Haskell-Cafe
mailing list