Deriving for phantom and empty types
[ghc.git] / testsuite / tests / deriving / should_compile / drv-empty-data.hs
1 {-# LANGUAGE RoleAnnotations #-}
2 {-# LANGUAGE DeriveTraversable, DeriveGeneric, EmptyCase,
3 DeriveDataTypeable, StandaloneDeriving, DeriveLift #-}
4
5 module DrvEmptyData where
6 import GHC.Generics (Generic, Generic1)
7 import Data.Data (Data)
8 import Language.Haskell.TH.Syntax (Lift)
9
10 data Void a deriving (Functor, Foldable, Traversable, Generic, Generic1, Lift)
11
12 -- We don't want to invoke the special case for phantom types here.
13 type role Void nominal
14
15 deriving instance Data a => Data (Void a)
16 deriving instance Eq (Void a)
17 deriving instance Ord (Void a)
18 deriving instance Show (Void a)
19 deriving instance Read (Void a)