data D a = D a; class A a where { } class A b => B b where { } instance A a => A (D a) where { } instance B (D a) where { }