Compute demand signatures assuming idArity
[ghc.git] / testsuite / tests / perf / compiler / WWRec.hs
1 {-# LANGUAGE MultiParamTypeClasses #-}
2 {-# LANGUAGE FlexibleContexts #-}
3 {-# LANGUAGE FlexibleInstances #-}
4 {-# LANGUAGE UndecidableInstances #-}
5
6 module WWRec where
7
8 class Rule f a where
9 get :: Decorator f => f a
10 class Monad f => Decorator f where
11 foo :: Rule f a => f a
12
13 data A1 = MkA1 A2
14 data A2 = MkA2 A3
15 data A3 = MkA3 A4
16 data A4 = MkA4 A5
17 data A5 = MkA5 A6
18 data A6 = MkA6 A7
19 data A7 = MkA7 A8
20 data A8 = MkA8 A9
21 data A9 = MkA9 A10
22 data A10 = MkA10 A11
23 data A11 = MkA11 A12
24 data A12 = MkA12 A13
25 data A13 = MkA13 A14
26 data A14 = MkA14 A15
27 data A15 = MkA15 A16
28 data A16 = MkA16 A17
29 data A17 = MkA17 A18
30 data A18 = MkA18 A19
31 data A19 = MkA19 A20
32 data A20 = MkA20 A21
33 data A21 = MkA21 A22
34 data A22 = MkA22 A23
35 data A23 = MkA23 A24
36 data A24 = MkA24 A25
37 data A25 = MkA25 A26
38 data A26 = MkA26 A27
39 data A27 = MkA27 A28
40 data A28 = MkA28 A29
41 data A29 = MkA29 A30
42 data A30 = MkA30 A1
43
44 instance Rule f A2 => Rule f A1 where get = MkA1 <$> foo
45 instance Rule f A3 => Rule f A2 where get = MkA2 <$> foo
46 instance Rule f A4 => Rule f A3 where get = MkA3 <$> foo
47 instance Rule f A5 => Rule f A4 where get = MkA4 <$> foo
48 instance Rule f A6 => Rule f A5 where get = MkA5 <$> foo
49 instance Rule f A7 => Rule f A6 where get = MkA6 <$> foo
50 instance Rule f A8 => Rule f A7 where get = MkA7 <$> foo
51 instance Rule f A9 => Rule f A8 where get = MkA8 <$> foo
52 instance Rule f A10 => Rule f A9 where get = MkA9 <$> foo
53 instance Rule f A11 => Rule f A10 where get = MkA10 <$> foo
54 instance Rule f A12 => Rule f A11 where get = MkA11 <$> foo
55 instance Rule f A13 => Rule f A12 where get = MkA12 <$> foo
56 instance Rule f A14 => Rule f A13 where get = MkA13 <$> foo
57 instance Rule f A15 => Rule f A14 where get = MkA14 <$> foo
58 instance Rule f A16 => Rule f A15 where get = MkA15 <$> foo
59 instance Rule f A17 => Rule f A16 where get = MkA16 <$> foo
60 instance Rule f A18 => Rule f A17 where get = MkA17 <$> foo
61 instance Rule f A19 => Rule f A18 where get = MkA18 <$> foo
62 instance Rule f A20 => Rule f A19 where get = MkA19 <$> foo
63 instance Rule f A21 => Rule f A20 where get = MkA20 <$> foo
64 instance Rule f A22 => Rule f A21 where get = MkA21 <$> foo
65 instance Rule f A23 => Rule f A22 where get = MkA22 <$> foo
66 instance Rule f A24 => Rule f A23 where get = MkA23 <$> foo
67 instance Rule f A25 => Rule f A24 where get = MkA24 <$> foo
68 instance Rule f A26 => Rule f A25 where get = MkA25 <$> foo
69 instance Rule f A27 => Rule f A26 where get = MkA26 <$> foo
70 instance Rule f A28 => Rule f A27 where get = MkA27 <$> foo
71 instance Rule f A29 => Rule f A28 where get = MkA28 <$> foo
72 instance Rule f A30 => Rule f A29 where get = MkA29 <$> foo
73 instance Rule f A1 => Rule f A30 where get = MkA30 <$> foo