Instance contexts constraining only type variables?

Wolfgang Jeltsch wolfgang@jeltsch.net
Wed, 23 Jan 2002 19:34:22 +0100


Hello,
say I have a type T defined the follwing way:
    newtype T a b = T (a b)
Now I want to make every T a b with a b beeing an instance of Eq also an
instance of Eq where (==) just test for equality of the encapsulated values. I
try this
    instance Eq (a b) => Eq (T a b) where
        (T x) == (T x') = x == x'
but it seems that this is not Haskell 98 conformant.
How do I implement this in Haskell 98?

Wolfgang