summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts/ghci044a.hs
blob: ac400d3ef99d20db5a0a39c95bf450a624fee1cb (plain)
1
2
3
4
5
6
7
8
9
--Testing flexible and Overlapping instances
class C a where { f :: a -> String; f _ = 3 }
instance C Int where { f = id }
: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]