summaryrefslogtreecommitdiff
path: root/testsuite/tests/quantified-constraints/T2893.hs
blob: ffec2cf72d22bac1d73f45d77a397958ecc249fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{-# LANGUAGE QuantifiedConstraints  #-}

-- Two simple examples that should work

module T2893 where

f :: forall b c. (Eq b, forall a. Eq a => Eq (c a)) => c b -> Bool
{-# NOINLINE f #-}
f x = x==x

g x = f [x]

data Rose f x = Rose x (f (Rose f x))

instance (Eq a, forall b. Eq b => Eq (f b))
      => Eq (Rose f a)  where
  (Rose x1 rs1) == (Rose x2 rs2)
     = x1==x2 && rs1 == rs2