import qualified Prelude as P class MyEq a where (==) :: a -> a -> P.Bool (/=) :: a -> a -> P.Bool x == y = P.not (x /= y) x /= y = x == y data TwoValue = One | Two instance MyEq TwoValue where One == Two = P.False Two == One = P.False _ == _ = P.True