:set -fno-warn-redundant-constraints --Testing flexible and Overlapping instances class C a where { f :: a -> String; f _ = "Default" } instance C Int where { f _ = "Zeroth" } :set -XFlexibleInstances instance C [Int] where f _ = "First" f [3::Int] instance C a => C [a] where f xs = "Second" f [4::Int] -- ***This should be an overlapping instances error!*** instance {-# OVERLAPPABLE #-} C a => C [a] where f xs = "Third" f [5::Int] -- Should be fine instance {-# OVERLAPPABLE #-} C a => C [a] where f xs = "Fourth" f [6::Int] -- Should be fine too, overrides instance C Bool where { f _ = "Bool" } f [True] -- Should be fine too, overrides