[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / tests / printing / Print002.stderr
1 Parsed, Haskellised:
2 module Print002 where
3 infixr 9 .
4 infixr 8 ^
5 infixr 8 ^^
6 infixr 3 &&
7 infixr 2 ||
8 infixr 0 $
9 infixl 9 !
10 infixl 9 //
11 infix  1 :=
12 infix  6 :+
13 infixr 8 **
14 infixl 7 *
15 infixl 7 /
16 infixl 7 `quot`
17 infixl 7 `rem`
18 infixl 7 `div`
19 infixl 7 `mod`
20 infixl 6 +
21 infixl 6 -
22 infix  4 ==
23 infix  4 /=
24 infix  4 <
25 infix  4 <=
26 infix  4 >=
27 infix  4 >
28 infixl 9 !!
29 infix  5 \\
30 infix  4 `elem`
31 infix  4 `notElem`
32 infixl 7 %
33 data Foo a b c
34     = MkFoo1 a a
35     | (:##) b c
36     | MkFoo3 b b
37     | (:***) c c
38     deriving (Eq, Ord)
39 class Bar a where
40     meth1 :: a -> a -> Bool
41     ///// :: a -> a -> Bool
42     meth2 :: a -> b -> Bool
43 class Bar a => Bar2 a where
44 f1 x y = x `MkFoo1` y
45 f1a x y = MkFoo1 x y
46 f2 x y = (:##) x y
47 f2a x y = x :## y
48 (....)
49     x y = MkFoo3 x y
50 (.....)
51     x y = x `MkFoo3` y
52 (<<<<)
53     x y = x :*** y
54 (<<<<)
55     x y = (:***) x y
56 f3a x y = meth1 x y
57 f3b x y = x `meth1` y
58 f3c x y = (/////) x y
59 f3d x y = x ///// y
60
61 Typechecked:
62 meth1 = meth1
63 (/////) = (/////)
64 meth2 = meth2
65 defm.Print002.Bar.meth1 =
66     (error) "No default method for \"Print002.Bar.defm.Print002.Bar.meth1\"\n"
67 defm.Print002.Bar.///// =
68     (error) "No default method for \"Print002.Bar.defm.Print002.Bar./////\"\n"
69 defm.Print002.Bar.meth2 =
70     (error) "No default method for \"Print002.Bar.defm.Print002.Bar.meth2\"\n"
71 sdsel.Print002.Bar2.Print002.Bar = d.Print002.Bar.t443
72 AbsBinds
73 [a, b, c]
74 [d.Eq.t192, d.Eq.t193, d.Eq.t194]
75 [(d.Eq.t195, dfun.Eq.Print002.Foo)]
76     (d.Eq.t268, d.Eq.t192)
77     (==.t212, (==))
78     (==.t209, (==.t212))
79     (d.Eq.t269, d.Eq.t194)
80     (==.t229, (==))
81     (d.Eq.t270, d.Eq.t193)
82     (==.t226, (==))
83     (==.t246, (==.t226))
84     (==.t243, (==.t226))
85     (==.t263, (==.t229))
86     (==.t260, (==.t229))
87     d.Eq.t195 = ({-dict-} [] [==, /=])
88     (==) :: Foo a b c -> Foo a b c -> Bool
89     (==) (MkFoo1 a1 a2) (MkFoo1 b1 b2)
90                  = (a1 ==.t209 b1) && (a2 ==.t212 b2)
91     (==) (:## a1 a2) (:## b1 b2)
92                  = (a1 ==.t226 b1) && (a2 ==.t229 b2)
93     (==) (MkFoo3 a1 a2) (MkFoo3 b1 b2)
94                  = (a1 ==.t243 b1) && (a2 ==.t246 b2)
95     (==) (:*** a1 a2) (:*** b1 b2)
96                  = (a1 ==.t260 b1) && (a2 ==.t263 b2)
97     (==) a b = False
98     (/=) = defm./=
99 AbsBinds
100 [a, b, c]
101 [d.Ord.t275, d.Ord.t276, d.Ord.t277, d.Eq.t274]
102 [(d.Ord.t278, dfun.Ord.Print002.Foo)]
103     (d.Ord.t425, d.Ord.t278)
104     (cmp3.t290, cmp3)
105     (cmp3.t295, cmp3.t290)
106     (cmp3.t300, cmp3.t290)
107     (cmp3.t305, cmp3.t290)
108     (d.Ord.t426, d.Ord.t425)
109     (cmp3.t310, cmp3)
110     (cmp3.t315, cmp3.t310)
111     (d.Ord.t422, d.Ord.t275)
112     (d.Ord.t423, d.Ord.t276)
113     (d.Ord.t424, d.Ord.t277)
114     d.Ord.t278 = ({-dict-} [d.Eq.t274] [<, <=, >=, >, max, min, cmp3])
115     (<) :: Foo a b c -> Foo a b c -> Bool
116     (<) a b = cmp3.t290 True False False a b
117     (<=) :: Foo a b c -> Foo a b c -> Bool
118     (<=) a b = cmp3.t295 True True False a b
119     (>=) :: Foo a b c -> Foo a b c -> Bool
120     (>=) a b = cmp3.t300 False True True a b
121     (>) :: Foo a b c -> Foo a b c -> Bool
122     (>) a b = cmp3.t305 False False True a b
123     max :: Foo a b c -> Foo a b c -> Foo a b c
124     max a b = cmp3.t310 b a a a b
125     min :: Foo a b c -> Foo a b c -> Foo a b c
126     min a b = cmp3.t315 a a b a b
127     cmp3 =
128         let
129           AbsBinds [tt316] [] [(cmp3, cmp3)]
130               cmp3 :: tt316 -> tt316 -> tt316 -> Foo a b c -> Foo a b c -> tt316
131               cmp3 lt eq gt a b
132                            = case (con2tag.Foo) a of
133                                a# -> case (con2tag.Foo) b of
134                                        b# -> if a# `eqInt` b# then
135                                                  if a# `ltInt` b# then
136                                                      lt
137                                                  else
138                                                      gt
139                                              else
140                                                  cmp3eq.t48.t419 lt eq gt a b
141                            where
142                                AbsBinds
143                                [a, b, c, tt400]
144                                [d.Ord.t402, d.Ord.t404, d.Ord.t403]
145                                [(cmp3eq, cmp3eq)]
146                                    (cmp3.t344, cmp3)
147                                    (cmp3.t341, cmp3.t344)
148                                    (cmp3.t363, cmp3)
149                                    (cmp3.t360, cmp3)
150                                    (cmp3.t382, cmp3.t360)
151                                    (cmp3.t379, cmp3.t360)
152                                    (cmp3.t401, cmp3.t363)
153                                    (cmp3.t398, cmp3.t363)
154                                    cmp3eq ::
155                                        tt400
156                                        -> tt400
157                                           -> tt400
158                                              -> Foo a b c -> Foo a b c -> tt400
159                                    cmp3eq
160                                        lt eq gt (MkFoo1 a1 a2) (MkFoo1 b1 b2)
161                                                = cmp3.t341
162                                                      lt
163                                                      (cmp3.t344 lt eq gt a2 b2)
164                                                      gt
165                                                      a1
166                                                      b1
167                                    cmp3eq
168                                        lt eq gt (:## a1 a2) (:## b1 b2)
169                                                = cmp3.t360
170                                                      lt
171                                                      (cmp3.t363 lt eq gt a2 b2)
172                                                      gt
173                                                      a1
174                                                      b1
175                                    cmp3eq
176                                        lt eq gt (MkFoo3 a1 a2) (MkFoo3 b1 b2)
177                                                = cmp3.t379
178                                                      lt
179                                                      (cmp3.t382 lt eq gt a2 b2)
180                                                      gt
181                                                      a1
182                                                      b1
183                                    cmp3eq
184                                        lt eq gt (:*** a1 a2) (:*** b1 b2)
185                                                = cmp3.t398
186                                                      lt
187                                                      (cmp3.t401 lt eq gt a2 b2)
188                                                      gt
189                                                      a1
190                                                      b1
191                                cmp3eq.t48.t419 = cmp3eq
192         in cmp3
193 AbsBinds [a, b, c] [] [(f1, f1)]
194     f1 :: a -> a -> Foo a b c
195     f1 x y = (MkFoo1) x y
196 AbsBinds [a, b, c] [] [(f1a, f1a)]
197     f1a :: a -> a -> Foo a b c
198     f1a x y = (MkFoo1) x y
199 AbsBinds [a, b, c] [] [(f2, f2)]
200     f2 :: b -> c -> Foo a b c
201     f2 x y = ((:##)) x y
202 AbsBinds [a, b, c] [] [(f2a, f2a)]
203     f2a :: b -> c -> Foo a b c
204     f2a x y = ((:##)) x y
205 AbsBinds [a, b, c] [] [(...., ....)]
206     (....) :: b -> b -> Foo a b c
207     (....)
208         x y = (MkFoo3) x y
209 AbsBinds [a, b, c] [] [(....., .....)]
210     (.....) :: b -> b -> Foo a b c
211     (.....)
212         x y = (MkFoo3) x y
213 AbsBinds [a, b, c] [] [(<<<<, <<<<)]
214     (<<<<) :: c -> c -> Foo a b c
215     (<<<<)
216         x y = ((:***)) x y
217     (<<<<)
218         x y = ((:***)) x y
219 AbsBinds [a] [d.Print002.Bar.t143] [(f3a, f3a)]
220     (Print002.Bar.meth1.t142, meth1)
221     f3a :: a -> a -> Bool
222     f3a x y = Print002.Bar.meth1.t142 x y
223 AbsBinds [a] [d.Print002.Bar.t151] [(f3b, f3b)]
224     (Print002.Bar.meth1.t149, meth1)
225     f3b :: a -> a -> Bool
226     f3b x y = x `Print002.Bar.meth1.t149` y
227 AbsBinds [a] [d.Print002.Bar.t158] [(f3c, f3c)]
228     (Print002.Bar./////.t157, (/////))
229     f3c :: a -> a -> Bool
230     f3c x y = Print002.Bar./////.t157 x y
231 AbsBinds [a] [d.Print002.Bar.t166] [(f3d, f3d)]
232     (Print002.Bar./////.t164, (/////))
233     f3d :: a -> a -> Bool
234     f3d x y = x `Print002.Bar./////.t164` y
235 AbsBinds [a, b, c] [] [(con2tag.Foo, con2tag.Foo)]
236     con2tag.Foo :: Foo a b c -> IntPrim
237     con2tag.Foo
238         (MkFoo1 _ _)
239                 = 0#
240     con2tag.Foo
241         (:## _ _)
242                 = 1#
243     con2tag.Foo
244         (MkFoo3 _ _)
245                 = 2#
246     con2tag.Foo
247         (:*** _ _)
248                 = 3#
249
250 =-=-=-=-=INTERFACE STARTS HERE=-=-=-=-= Print002
251 interface Print002 where
252 (....) :: b -> b -> Foo a b c {-# ARITY _ = 2 #-}
253 (.....) :: b -> b -> Foo a b c {-# ARITY _ = 2 #-}
254 (<<<<) :: c -> c -> Foo a b c {-# ARITY _ = 2 #-}
255 f1 :: a -> a -> Foo a b c {-# ARITY _ = 2 #-}
256 f1a :: a -> a -> Foo a b c {-# ARITY _ = 2 #-}
257 f2 :: b -> c -> Foo a b c {-# ARITY _ = 2 #-}
258 f2a :: b -> c -> Foo a b c {-# ARITY _ = 2 #-}
259 f3a :: Bar a => a -> a -> Bool {-# ARITY _ = 1 #-}
260 f3b :: Bar a => a -> a -> Bool {-# ARITY _ = 1 #-}
261 f3c :: Bar a => a -> a -> Bool {-# ARITY _ = 1 #-}
262 f3d :: Bar a => a -> a -> Bool {-# ARITY _ = 1 #-}
263 class Bar a where
264     meth1 :: a -> a -> Bool
265     (/////) :: a -> a -> Bool
266     meth2 :: a -> b -> Bool
267 class (Bar a) => Bar2 a
268 data Foo a b c = MkFoo1 a a | (:##) b c | MkFoo3 b b | (:***) c c
269 instance (Eq a, Eq b, Eq c) => Eq (Foo a b c)
270 instance (Ord a, Ord b, Ord c) => Ord (Foo a b c)
271 =-=-=-=-=INTERFACE STOPS  HERE=-=-=-=-=
272