Testsuite: tabs -> spaces [skip ci]
[ghc.git] / testsuite / tests / typecheck / should_compile / syn-perf.hs
1 {-# LANGUAGE TypeOperators, DeriveDataTypeable #-}
2
3 -- This is a performance test. In GHC 6.4, it simply wouldn't compile
4 -- because the types got exponentially large, due to poor handling of
5 -- type synonyms
6
7 module ShouldCompile where
8
9 import Data.Word
10 import Data.Int
11 import Data.Typeable
12
13 data HNil = HNil deriving (Eq,Show,Read)
14 data HCons e l = HCons e l deriving (Eq,Show,Read)
15
16 type e :*: l = HCons e l
17 -- In GHC 6.4 the deeply-nested use of this
18 -- synonym gave rise to exponential behaviour
19
20 --- list endian16
21 newtype Tables = Tables [TableInfo] deriving (Show, Typeable)
22
23 type TableInfo =
24 AvgPot :*:
25 NumPlayers :*:
26 Waiting :*:
27 PlayersFlop :*:
28 TableName :*:
29 TableID :*:
30 GameType :*:
31 InfoMaxPlayers :*:
32 RealMoneyTable :*:
33 LowBet :*:
34 HighBet :*:
35 MinStartMoney :*:
36 MaxStartMoney :*:
37 GamesPerHour :*:
38 TourType :*:
39 TourID :*:
40 BetType :*:
41 CantReturnLess :*:
42 AffiliateID :*:
43 NIsResurrecting :*:
44 MinutesForTimeout :*:
45 SeatsToResurrect :*:
46 LangID :*:
47 HNil
48
49 newtype TourType = TourType TourType_ deriving (Show, Typeable)
50 newtype AvgPot = AvgPot Word64 deriving (Show, Typeable)
51 newtype NumPlayers = NumPlayers Word16 deriving (Show, Typeable)
52 newtype Waiting = Waiting Word16 deriving (Show, Typeable)
53 newtype PlayersFlop = PlayersFlop Word8 deriving (Show, Typeable)
54 newtype TableName = TableName String deriving (Show, Typeable)
55 newtype TableID = TableID Word32 deriving (Show, Typeable)
56 newtype OldTableID = OldTableID Word32 deriving (Show, Typeable)
57 newtype GameType = GameType GameType_ deriving (Show, Typeable)
58 newtype InfoMaxPlayers = InfoMaxPlayers Word16 deriving (Show, Typeable)
59 newtype RealMoneyTable = RealMoneyTable Bool deriving (Show, Typeable)
60 newtype LowBet = LowBet RealMoney_ deriving (Show, Typeable)
61 newtype HighBet = HighBet RealMoney_ deriving (Show, Typeable)
62 newtype MinStartMoney = MinStartMoney RealMoney_ deriving (Show, Typeable)
63 newtype MaxStartMoney = MaxStartMoney RealMoney_ deriving (Show, Typeable)
64 newtype GamesPerHour = GamesPerHour Word16 deriving (Show, Typeable)
65 newtype TourID = TourID Word32 deriving (Show, Typeable)
66 newtype BetType = BetType BetType_ deriving (Show, Typeable)
67 newtype CantReturnLess = CantReturnLess Word32 deriving (Show, Typeable)
68 newtype AffiliateID = AffiliateID [Word8] deriving (Show, Typeable)
69 newtype NIsResurrecting = NIsResurrecting Word32 deriving (Show, Typeable)
70 newtype MinutesForTimeout = MinutesForTimeout Word32 deriving (Show, Typeable)
71 newtype SeatsToResurrect = SeatsToResurrect Word32 deriving (Show, Typeable)
72 newtype LangID = LangID Word32 deriving (Show, Typeable)
73
74 data GameType_
75 = EmptyGame
76 | Holdem
77 | OmahaHoldem
78 | OmahaHiLo
79 | SevenCardStud
80 | SevenCardStudLoHi
81 | OneToOne
82 | OneToOneOmaha
83 | OneToOne7CS
84 | OneToOneOmahaHL
85 | OneToOne7CSHL
86 | TeenPatti
87 | OneToOneTeenPatti
88 deriving (Eq, Show, Typeable)
89
90 type RealMoney_ = Word64
91
92 data TourType_
93 = TourNone
94 | TourSingle
95 | TourMulti
96 | TourHeadsUpMulti
97 deriving (Enum, Eq, Show, Typeable)
98
99 data BetType_
100 = BetNone
101 | BetFixed
102 | BetPotLimit
103 | BetNoLimit
104 | BetBigRiver
105 | BetTeenPatti
106 | BetTeenPattiFixed
107 deriving (Enum, Eq, Show, Typeable)
108