1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
{-# LANGUAGE TypeFamilies, EmptyDataDecls #-} module InstEqContext2 where data E v a = E a data RValue instance (Eq a, v ~ RValue) => Eq (E v a) where E x == E y = x == y a :: E v Int a = undefined foo = a == a