blob: 3bccb6745b79c78bbf151fee020fdc1512cf13aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
{-# LANGUAGE AllowAmbiguousTypes, RankNTypes, QuantifiedConstraints #-}
module T22223 where
import Data.Kind
type C :: Type -> Type -> Constraint
class C a b
-- Change the order of quantification
foo :: ( forall a b. (Eq a, Ord b) => C a b
, forall b a. (Eq a, Ord b) => C a b
, Eq x
, Ord y )
=> ( C x y => r ) -> r
foo r = r
-- Permute the constraints in the context
bar :: ( forall a b. (Eq a, Ord b) => C a b
, forall a b. (Ord b, Eq a) => C a b
, Eq x
, Ord y )
=> ( C x y => r ) -> r
bar r = r
|