Greg Buchholz [EMAIL PROTECTED] wrote:
Here's a question for the Haskell community that I've been
wrestling with lately. When we say lists are monads what does that
mean? I can see one of two things. First the slightly superficial...
A.) Lists can be made members of the
Here's a question for the Haskell community that I've been wrestling
with lately. When we say lists are monads what does that mean? I can
see one of two things. First the slightly superficial...
A.) Lists can be made members of the Monads class, and you can define
a couple of
Interpretation A is correct. The type (constructor) of Lists gives a
monad together with return x = [x] and x = f = concatMap f x.
Interpretation B doesn't really work, because the monad interface does
not give one the ability to write head or tail. You basically have
return (which gets you from