
16 Nov
2008
16 Nov
'08
4:32 p.m.
Hi, 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, Maurício