012d61fc315e79a059e2506c0a2a46a914dd7dcd
[ghc.git] / testsuite / tests / polykinds / T9569.hs
1 {-# LANGUAGE RankNTypes, ConstraintKinds, KindSignatures, DataKinds, TypeFamilies #-}
2 module T9569 where
3
4 import GHC.Prim
5
6 data Proxy (c :: Constraint)
7
8 class Deferrable (c :: Constraint) where
9 defer :: Proxy c -> (c => a) -> a
10
11 deferPair :: (Deferrable c1, Deferrable c2) =>
12 Proxy (c1,c2) -> ((c1,c2) => a) -> a
13 deferPair = undefined
14
15 instance (Deferrable c1, Deferrable c2) => Deferrable (c1,c2) where
16 -- defer p f = deferPair p f -- Succeeds
17 defer = deferPair -- Fails
18
19 {-
20 [G] Deferrable c1, Deferrable c2
21
22 [W] Proxy (c1,c2) -> ((c1,c2) => a) -> a ~ Proxy (c1x,c2x) -> ((c1x,c2x) => ax) -> ax
23 [w] Deferrable c1x
24 [w] Deferrable c2x
25 -}