a78e57f8d819f074ec64a07372038523baf8f0c1
[ghc-hetmet.git] / ghc / tests / programs / cvh_unboxing / Append.lhs
1 \section{Versions of {\tt append}}
2
3 \begin{code}
4 module Append where
5
6 import PrelBase
7 import Types
8 \end{code}
9
10 \begin{code}
11 append_ :: [a] -> [a] -> [a]
12 append_ (x:xs) ys = x : (append_ xs ys)
13 append_ [] ys = ys
14
15 append_L_S_S :: String -> S Char -> S Char
16 append_L_S_S (a: b: c: d: e: a1: b1: c1: d1: e1: xs) ys  
17  = S5 a b c d e (S5 a1 b1 c1 d1 e1 (append_L_S_S xs ys))
18 append_L_S_S (a: b: c: d: e: xs) ys  
19  = S5 a b c d e (append_L_S_S xs ys)
20 append_L_S_S (a: b: c: d: _) ys
21  = S4 a b c d ys
22 append_L_S_S (a: b: c: _) ys
23  = S3 a b c ys
24 append_L_S_S (a: b: _) ys
25  = S2 a b ys
26 append_L_S_S [a] ys
27  = S1 a ys
28 append_L_S_S [] ys = ys
29
30 append_F_S_S :: F Char -> S Char -> S Char
31 append_F_S_S (F5 a b c d e (F5 a1 b1 c1 d1 e1 xs)) ys  
32  = S5 a b c d e (S5 a1 b1 c1 d1 e1 (append_F_S_S xs ys))
33 append_F_S_S (F5 a b c d e xs) ys  
34  = S5 a b c d e (append_F_S_S xs ys)
35 append_F_S_S (F4 a b c d) ys
36  = S4 a b c d ys
37 append_F_S_S (F3 a b c) ys
38  = S3 a b c ys
39 append_F_S_S (F2 a b) ys
40  = S2 a b ys
41 append_F_S_S (F1 a) ys
42  = S1 a ys
43 append_F_S_S FN ys = ys
44
45
46 append_L_SC_SC :: String -> SC -> SC
47 append_L_SC_SC (C# a: C# b: C# c: C# d: 
48                 C# e: C# a1: C# b1: C# c1: 
49                 C# d1: C# e1: xs) ys  
50  = SC5 a b c d e (SC5 a1 b1 c1 d1 e1 (append_L_SC_SC xs ys))
51 append_L_SC_SC (C# a: C# b: C# c: C# d: 
52                 C# e: xs) ys  
53  = SC5 a b c d e (append_L_SC_SC xs ys)
54 append_L_SC_SC (C# a: C# b: C# c: C# d: _) ys
55  = SC4 a b c d ys
56 append_L_SC_SC (C# a: C# b: C# c: _) ys
57  = SC3 a b c ys
58 append_L_SC_SC (C# a: C# b: _) ys
59  = SC2 a b ys
60 append_L_SC_SC [C# a] ys
61  = SC1 a ys
62 append_L_SC_SC [] ys = ys
63
64
65 append_FC_SC_SC :: FC -> SC -> SC
66 append_FC_SC_SC (FC5 a b c d e (FC5 a1 b1 c1 d1 e1 xs)) ys  
67  = SC5 a b c d e (SC5 a1 b1 c1 d1 e1 (append_FC_SC_SC xs ys))
68 append_FC_SC_SC (FC5 a b c d e xs) ys  
69  = SC5 a b c d e (append_FC_SC_SC xs ys)
70 append_FC_SC_SC (FC4 a b c d) ys
71  = SC4 a b c d ys
72 append_FC_SC_SC (FC3 a b c) ys
73  = SC3 a b c ys
74 append_FC_SC_SC (FC2 a b) ys
75  = SC2 a b ys
76 append_FC_SC_SC (FC1 a) ys
77  = SC1 a ys
78 append_FC_SC_SC FCN ys = ys
79
80 append_F_L_L :: F a -> [a] -> [a]
81 append_F_L_L (F5 a b c d e (F5 a1 b1 c1 d1 e1 xs)) ys  
82  = a: b: c: d: e: a1: b1: c1: d1: e1: (append_F_L_L xs ys)
83 append_F_L_L (F5 a b c d e xs) ys  
84  = a: b: c: d: e: (append_F_L_L xs ys)
85 append_F_L_L (F4 a b c d) ys  = a: b: c: d: ys
86 append_F_L_L (F3 a b c) ys  = a: b: c: ys
87 append_F_L_L (F2 a b) ys  = a: b: ys
88 append_F_L_L (F1 a) ys  = a: ys
89 append_F_L_L FN ys = ys
90
91 append_S_L_L :: S Char -> String -> String
92 append_S_L_L (S5 a b c d e (S5 a1 b1 c1 d1 e1 xs)) ys  
93  =  a:  b:  c:  d:  e:  a1: b1:  c1:  d1:  e1: (append_S_L_L xs ys)
94 append_S_L_L (S5 a b c d e xs) ys  
95  =  a:  b:  c:  d: e: (append_S_L_L xs ys)
96 append_S_L_L (S4 a b c d xs) ys  
97  =  a:  b:  c:  d: (append_S_L_L xs ys)
98 append_S_L_L (S3 a b c xs) ys  
99  =  a:  b:  c: (append_S_L_L xs ys)
100 append_S_L_L (S2 a b xs) ys  
101  =  a:  b: (append_S_L_L xs ys)
102 append_S_L_L (S1 a xs) ys  
103  =  a: (append_S_L_L xs ys)
104 append_S_L_L SN ys = ys
105
106
107 append_FC_L_L :: FC -> String -> String
108 append_FC_L_L (FC5 a b c d e (FC5 a1 b1 c1 d1 e1 xs)) ys  
109  = C# a: C# b: C# c: C# d: C# e: C# a1: 
110       C# b1: C# c1: C# d1: C# e1: 
111          (append_FC_L_L xs ys)
112 append_FC_L_L (FC5 a b c d e xs) ys  
113  = C# a: C# b: C# c: C# d: 
114       C# e: (append_FC_L_L xs ys)
115 append_FC_L_L (FC4 a b c d) ys  
116  = C# a: C# b: C# c: C# d: ys
117 append_FC_L_L (FC3 a b c) ys  
118  = C# a: C# b: C# c: ys
119 append_FC_L_L (FC2 a b) ys  = C# a: C# b: ys
120 append_FC_L_L (FC1 a) ys  = C# a: ys
121 append_FC_L_L FCN ys = ys
122
123 append_SC_L_L :: SC -> String -> String
124 append_SC_L_L (SC5 a b c d e (SC5 a1 b1 c1 d1 e1 xs)) ys  
125  = C# a: C# b: C# c: C# d: C# e: C# a1: 
126       C# b1: C# c1: C# d1: C# e1: 
127           (append_SC_L_L xs ys)
128 append_SC_L_L (SC5 a b c d e xs) ys  
129  = C# a: C# b: C# c: C# d: 
130       C# e: (append_SC_L_L xs ys)
131 append_SC_L_L (SC4 a b c d xs) ys  
132  = C# a: C# b: C# c: C# d: (append_SC_L_L xs ys)
133 append_SC_L_L (SC3 a b c xs) ys  
134  = C# a: C# b: C# c: (append_SC_L_L xs ys)
135 append_SC_L_L (SC2 a b xs) ys  
136  = C# a: C# b: (append_SC_L_L xs ys)
137 append_SC_L_L (SC1 a xs) ys  
138  = C# a: (append_SC_L_L xs ys)
139 append_SC_L_L SCN ys = ys
140 \end{code}