On Dec 3, 2007 6:36 PM, Ben Franksen <ben.franksen at online.de> wrote:
> then the special features of IO
> will remain associated with monads in general, leading to a whole jumble of
> completely wrong ideas about them.
As I only learnt about monads a couple of years ago, the process is
still fresh in my mind. I wasted quite a bit of time labouring under
the impression that monads were primarily about sequencing. But that
wasn't because I incorrectly generalised from IO. It was because
countless people out there explicitly said they were about sequencing.
I suspect that if courses started with the List monad there'd be
countless blogs telling people that monads are a way to eliminate
loops from your code like the way list comprehensions are used in
Python.
> This is yet another problem with IO as the standard example for monads: its
> effect base is huge and poorly structured.
You don't teach *all* of IO to students in one go!
> This again makes it difficult to
> see exactly which intuitions about IO can be generalized to arbitrary
> monads and which not.
That's true of any monad. IO is unique. [] is unique. Cont is unique.
All of them can lead you down the garden path. You need to see
multiple monads, and it helps if you can sneak an example under a
student's nose so they can already reason about monads before they
even know what a monad is.
> What is pointless about failure and how to handle it?
It's pointless when you're still trying to make your first tweaks to
"Hello, World!" work.
--
Dan