class C a where { type T a; -- foo :: a -> List Char; } data D a = D a; instance C a => C (D (T a)) where { type T (D (T a)) = T a; -- foo _ = "ok"; -- ambiguous signature } instance C Int where { type T Int = Bool; -- foo _ = "fail"; } bar :: T (D (T Int)) -> Bool; bar b = b; main = bar True;