blob: d78c5c25bc8be683479a9b9d92e750f70beda349 (
plain)
1
2
3
4
5
6
7
8
9
|
--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]
-- Should override the identical one preceding
instance C [Int] where f _ = "Second"
f [3::Int]
|