{-# OPTIONS -fglasgow-exts #-} {-# OPTIONS -fallow-overlapping-instances #-} class Foo x where foo :: x -> () foo _ = () instance Foo String instance Foo [a] main = print $ foo "bar" {- *Main> main () *Main> foo "bar" :1:0: Overlapping instances for Foo [Char] arising from use of `foo' at :1:0-2 Matching instances: Test.hs:10:0: instance Foo [a] Test.hs:9:0: instance Foo String In the definition of `it': it = foo "bar" -}