[Haskell-cafe] Lack of expressiveness in kinds?

Andrew Wagner wagner.andrew at gmail.com
Thu Mar 15 16:22:01 EDT 2007

Ok, so I'm inching closer to understanding monads, and this question
popped up today. Consider the following 2 declarations:

data Foo a = Bar a
data (Ord a) => Baz a = Bah a

Note that both of these have kind * -> *. However, Baz could never be
an instance of monad, because there is a restriction on the types it
can operate on. Foo, however, is completely polymorphic, without
limitation. It seems to me that there ought to be a way to express the
difference between the two in the type/kind system. For example, you
can almost, but not quite, say that in the declaration "class Monad m
where..", m must be of kind *->*, but that's not quite enough to say,
because of this example. Am I just missing something, or is there a
reason the kind of Baz shouldn't be something other than *->*?

More information about the Haskell-Cafe mailing list