SCC analysis for instances as well as types/classes
[ghc.git] / testsuite / tests / typecheck / should_compile / T9939.hs
1 {-# LANGUAGE GADTs #-}
2
3 module T9939 where
4
5 f1 :: (Eq a, Ord a) => a -> a -> Bool
6 -- Eq a redundant
7 f1 x y = (x == y) && (x > y)
8
9 f2 :: (Eq a, Ord a) => a -> a -> Bool
10 -- Ord a redundant, but Eq a is reported
11 f2 x y = (x == y)
12
13 f3 :: (Eq a, a ~ b, Eq b) => a -> b -> Bool
14 -- Eq b redundant
15 f3 x y = x==y
16
17 data Equal a b where
18 EQUAL :: Equal a a
19
20 f4 :: (Eq a, Eq b) => a -> b -> Equal a b -> Bool
21 -- Eq b redundant
22 f4 x y EQUAL = y==y
23