Implement QuantifiedConstraints
[ghc.git] / testsuite / tests / quantified-constraints / T2893.hs
1 {-# LANGUAGE QuantifiedConstraints #-}
2
3 -- Two simple examples that should work
4
5 module T2893 where
6
7 f :: forall b c. (Eq b, forall a. Eq a => Eq (c a)) => c b -> Bool
8 {-# NOINLINE f #-}
9 f x = x==x
10
11 g x = f [x]
12
13 data Rose f x = Rose x (f (Rose f x))
14
15 instance (Eq a, forall b. Eq b => Eq (f b))
16 => Eq (Rose f a) where
17 (Rose x1 rs1) == (Rose x2 rs2)
18 = x1==x2 && rs1 == rs2