[Haskell-cafe] Lists vs. Monads
Greg Buchholz
haskell at sleepingsquirrel.org
Fri Jul 15 11:52:15 EDT 2005
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 functions, "bind" and "return" that obey the Three Laws.
...or the more fundamental...
B.) Monads somehow define lists. If you had a version of Haskell
without recursive data types you wouldn't be at a loss, because
you could always use monads to recreate lists. Maybe "bind" would
replace the job of "cons" and "return" would replace "head" or
somesuch.
I'm of the mind that A.) is the right interpretation, but I've seen the
"lists are monads" meme mentioned enough that I sometimes question it.
In fact, I had a hard time articulating B.) because I don't know what
the other possibilies are. In case it isn't clear enough, here's another
analogy...
A.) Insects are cold blooded animals.
...while that is 100% true, many other animals are cold blooded. It
doesn't get at the essence of what it means to be an insect. Compare
with a statment like...
B.) Insects are six-legged animals with an exoskeleton.
...which tells us a lot more about the fundamental nature of insects.
Thanks,
Greg Buchholz
More information about the Haskell-Cafe
mailing list