[Haskell-cafe] Type question in instance of a class

Maurí­cio briqueabraque at yahoo.com
Sun Nov 16 16:32:11 EST 2008


Why is this wrong?

class MyClass r where function :: r -> s

data MyData u = MyData u

instance MyClass (MyData v) where function (MyData a) = a

GHC says that the type of the result of 'function' is both determined by
the "rigid type" from MyClass and  the "rigid type" from MyData. But why
can't both be the same?

What am I doing wrong?

Thanks for your help,

More information about the Haskell-Cafe mailing list