diff options
Diffstat (limited to 'testsuite/tests/quantified-constraints/T2893c.hs')
-rw-r--r-- | testsuite/tests/quantified-constraints/T2893c.hs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/quantified-constraints/T2893c.hs b/testsuite/tests/quantified-constraints/T2893c.hs new file mode 100644 index 0000000000..832d0f8428 --- /dev/null +++ b/testsuite/tests/quantified-constraints/T2893c.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE QuantifiedConstraints #-} + +module T2893c where + +data Rose f x = Rose x (f (Rose f x)) + +instance Eq a => Eq (Rose f a) where + (Rose x1 _) == (Rose x2 _) = x1==x2 + +-- Needs superclasses +instance (Ord a, forall b. Ord b => Ord (f b)) + => Ord (Rose f a) where + (Rose x1 rs1) >= (Rose x2 rs2) + = x1 >= x2 && rs1 == rs2 + a <= b = False -- Just to suppress the warning |