summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/T9569.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2014-11-21 11:22:52 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2014-11-21 11:35:27 +0000
commit230b013b654508f77c5d8cec9d4de9b7c86e1370 (patch)
treed45a42d21d55dc603bb5488f44ed5342b3cd07b0 /testsuite/tests/polykinds/T9569.hs
parente6391208347103f8c21a446fbc657e979051db54 (diff)
downloadhaskell-230b013b654508f77c5d8cec9d4de9b7c86e1370.tar.gz
Test Trac #9569
Diffstat (limited to 'testsuite/tests/polykinds/T9569.hs')
-rw-r--r--testsuite/tests/polykinds/T9569.hs25
1 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/polykinds/T9569.hs b/testsuite/tests/polykinds/T9569.hs
new file mode 100644
index 0000000000..012d61fc31
--- /dev/null
+++ b/testsuite/tests/polykinds/T9569.hs
@@ -0,0 +1,25 @@
+{-# LANGUAGE RankNTypes, ConstraintKinds, KindSignatures, DataKinds, TypeFamilies #-}
+module T9569 where
+
+import GHC.Prim
+
+data Proxy (c :: Constraint)
+
+class Deferrable (c :: Constraint) where
+ defer :: Proxy c -> (c => a) -> a
+
+deferPair :: (Deferrable c1, Deferrable c2) =>
+ Proxy (c1,c2) -> ((c1,c2) => a) -> a
+deferPair = undefined
+
+instance (Deferrable c1, Deferrable c2) => Deferrable (c1,c2) where
+ -- defer p f = deferPair p f -- Succeeds
+ defer = deferPair -- Fails
+
+{-
+ [G] Deferrable c1, Deferrable c2
+
+ [W] Proxy (c1,c2) -> ((c1,c2) => a) -> a ~ Proxy (c1x,c2x) -> ((c1x,c2x) => ax) -> ax
+ [w] Deferrable c1x
+ [w] Deferrable c2x
+-} \ No newline at end of file