[Haskell-cafe] What are Kind errors and how do you fix them?

S. Alexander Jacobson alex at alexjacobson.com
Tue Mar 23 16:58:37 EST 2004

Implementing Reverse from before, I am running
into this weird error:

  type ReverseType a string = (string ->(string,a))
  data Reverse a string = Reverse (ReverseType a string)

  instance Monad (Reverse a s) where
	return x = Reverse (\text -> (text,x))
	(Reverse p) >>= k = Reverse p3
		p3 s0 = p2 s1
			(Reverse p2) = k a
			(s1,a)=p s0

Produces the error:

    Kind error: Expecting kind `* -> *', but `Reverse a s' has kind `*'
    When checking kinds in `Monad (Reverse a s)'
    In the instance declaration for `Monad (Reverse a s)'

I have no clue what this error message means.


S. Alexander Jacobson                  mailto:me at alexjacobson.com
tel:917-770-6565                       http://alexjacobson.com

More information about the Haskell-Cafe mailing list