summaryrefslogtreecommitdiff
path: root/testsuite/tests/generics/GenCanDoRep1.hs
blob: 1ddb39aee15bda753ca79d68c99b47e5a4a00663 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeOperators #-}

module CanDoRep1 where

import GHC.Generics (Generic, Generic1)


-- We should be able to generate a generic representation for these types
data A a                                deriving Generic1

data B a = B0 | B1                      deriving Generic1

data C a = C0 | C1 { c11 :: a, c12 :: (C a) }
  deriving (Generic, Generic1)

data D a = D (Either Int a)             deriving Generic1

data E a = E (Either Int (E a))         deriving Generic1

data F c b a = F (c, b, a)              deriving Generic1
data G c b a = G [(c, c, c, c, b, a)]   deriving (Generic1, Show)


data Odd a = Odd a (Even a)             deriving Generic1
data Even a = NilEven | Even a (Odd a)  deriving Generic1

data Odd' a = Odd' a (Even' a)          deriving Generic1
data Even' a = NilEven' | Even' a (Odd' a)

data H b a = H0 | H1 (H b b)            deriving Generic1

data (:*:) a b = a :*: b                deriving (Generic, Generic1)