summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_compile/T10561.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/deriving/should_compile/T10561.hs')
-rw-r--r--testsuite/tests/deriving/should_compile/T10561.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_compile/T10561.hs b/testsuite/tests/deriving/should_compile/T10561.hs
new file mode 100644
index 0000000000..85acc516d9
--- /dev/null
+++ b/testsuite/tests/deriving/should_compile/T10561.hs
@@ -0,0 +1,19 @@
+{-# LANGUAGE PolyKinds, DeriveFunctor, RankNTypes #-}
+
+module T10561 where
+
+-- Ultimately this should "Just Work",
+-- but in GHC 7.10 it gave a Lint failure
+-- For now (HEAD, Jun 2015) it gives a kind error message,
+-- which is better than a crash
+
+newtype Compose f g a = Compose (f (g a)) deriving Functor
+
+{-
+instance forall (f_ant :: k_ans -> *)
+ (g_anu :: * -> k_ans).
+ (Functor f_ant, Functor g_anu) =>
+ Functor (Compose f_ant g_anu) where
+ fmap f_anv (T10561.Compose a1_anw)
+ = Compose (fmap (fmap f_anv) a1_anw)
+-}