{-# OPTIONS -fglasgow-exts #-} {-# OPTIONS -fallow-overlapping-instances #-} {-# OPTIONS -fallow-undecidable-instances #-} module FooModule(Dependent(..), Abstract(..), Concrete(..)) where class Dependent a class (Dependent b) => Abstract a b | a -> b class Abstract a b => Concrete a b where foo :: a -> String foo x = bar x bar :: a -> String bar _ = "default" instance (Show a, Abstract a b) => Concrete a b where foo x = show x {-- -- Uncommenting this solves the problem: data Dummy = Dummy instance Dependent Dummy instance Abstract Dummy Dummy instance Concrete Dummy Dummy --} {-- -- Uncommenting this results in error: instance (Abstract a b) => Concrete a b --}