Show sources of cost centers in .prof
[ghc.git] / testsuite / tests / generics / GenCannotDoRep0_0.hs
1 {-# LANGUAGE DeriveGeneric #-}
2 {-# LANGUAGE ExistentialQuantification #-}
3 {-# LANGUAGE StandaloneDeriving #-}
4 {-# LANGUAGE FlexibleInstances #-}
5 {-# LANGUAGE TypeFamilies #-}
6 {-# LANGUAGE DatatypeContexts #-}
7
8 module CannotDoRep0_0 where
9
10 import GHC.Generics hiding (P, D)
11
12 -- We do not support existential quantification
13 data Dynamic = forall a. Dynamic a deriving Generic
14
15 -- Partial instantiation of types is not allowed
16 data P a = P a
17 deriving instance Generic (P Int)
18
19 -- This gets trickier for data families
20 data family D a b
21 data instance D Char b
22 data instance (Show b) => D Int b
23 data instance D () ()
24
25 -- Bad: second argument is instantiated
26 deriving instance Generic (D Char Char)
27 -- Bad: has context
28 deriving instance Generic (D Int a)
29 -- Ok
30 deriving instance Generic (D () ())