summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_fail/drvfail-foldable-traversable1.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/deriving/should_fail/drvfail-foldable-traversable1.hs')
-rw-r--r--testsuite/tests/deriving/should_fail/drvfail-foldable-traversable1.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_fail/drvfail-foldable-traversable1.hs b/testsuite/tests/deriving/should_fail/drvfail-foldable-traversable1.hs
new file mode 100644
index 0000000000..ced3f98c63
--- /dev/null
+++ b/testsuite/tests/deriving/should_fail/drvfail-foldable-traversable1.hs
@@ -0,0 +1,21 @@
+{-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
+module ShouldFail where
+
+import Data.Foldable
+import Data.Traversable
+
+-- Derive Traversable without Functor
+data Trivial1 a = Trivial1 a
+ deriving (Foldable,Traversable)
+
+-- Derive Traversable without Foldable
+data Trivial2 a = Trivial2 a
+ deriving (Functor,Traversable)
+
+-- Foldable with function type
+data Infinite a = Infinite (Int -> a)
+ deriving (Functor,Foldable,Traversable)
+
+-- Foldable with function type
+data Cont r a = Cont ((a -> r) -> r)
+ deriving (Functor,Foldable,Traversable)