On 2008 Sep 27, at 9:24, Andrew Coppin wrote:
David Menendez wrote:
I wouldn't say that. It's important to remember that Haskell class
Monad does not, and can not, represent *all* monads, only (strong)
monads built on a functor from the category of Haskell types and
functions to itself.
Data.Set is a functor from the category of Haskell types *with
decidable ordering* and *order-preserving* functions to itself.
That's
not the same category, although it is closely related.
I nominate this post for the September 2008 Most Incomprehensible
Cafe Post award! :-D
Seriously, that sounded like gibberish. (But then, you're talking to
somebody who can't figure out the difference between a set and a
class, so...)
That response required a certain amount of category theory to grok.
When you have a typeclass, the constraints (that is, the (Foo a =>)
contexts) on it are the exact constraints on members of the class.
You can't add more or leave some out.
Set and Map both require an additional constraint over those of
Functor and Monad: (Ord a =>). Since you can't add constraints on
top of a typeclass, you can't make them members of Functor or Monad.
(Unless you use some Oleg-style hackery.)
--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon university KF8NH
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe