{-# LANGUAGE FlexibleInstances #-} unit p where signature A where data K a instance Show (K Int) instance Show (K Bool) unit q where signature A where data K a instance Show (K Bool) instance Show (K Int) unit r where dependency p[A=] dependency q[A=] module R where import A f :: K Int -> String f = show g :: K Bool -> String g = show