summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_fail/drvfail-foldable-traversable1.hs
blob: ced3f98c630717669d59fde77c7875e79d59cf19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)