[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / tests / reader / read001.stderr
1 Parsed, Haskellised:
2 module OneOfEverything (
3         fixn,
4         FooData,
5         FooDataB(..),
6         FooDataC(..),
7         EqTree(EqLeaf,  EqBranch),
8         EqClass(..),
9         OrdClass(orda,  ordb),
10         OneC..,
11         OneOfEverything..
12     ) where
13 import Prelude {-
14            interface Prelude where
15                import PreludeBuiltin ( trace, Char )
16                import PreludeCore ( Bool, String, ReadS, ShowS, Text )
17                import PreludeRatio (
18                    %, numerator, denominator, approxRational )
19                import PreludeComplex (
20                    realPart,
21                    imagPart,
22                    conjugate,
23                    mkPolar,
24                    cis,
25                    polar,
26                    magnitude,
27                    phase )
28                import PreludeList (
29                    head,
30                    last,
31                    tail,
32                    init,
33                    null,
34                    \\,
35                    genericLength,
36                    length,
37                    !!,
38                    filter,
39                    partition,
40                    foldl1,
41                    scanl,
42                    scanl1,
43                    foldr1,
44                    scanr,
45                    scanr1,
46                    iterate,
47                    repeat,
48                    cycle,
49                    take,
50                    drop,
51                    splitAt,
52                    takeWhile,
53                    dropWhile,
54                    span,
55                    break,
56                    lines,
57                    words,
58                    unlines,
59                    unwords,
60                    nub,
61                    reverse,
62                    and,
63                    or,
64                    any,
65                    all,
66                    elem,
67                    notElem,
68                    sum,
69                    product,
70                    sums,
71                    products,
72                    maximum,
73                    minimum,
74                    concat,
75                    transpose,
76                    zip,
77                    zip3,
78                    zip4,
79                    zip5,
80                    zip6,
81                    zip7,
82                    zipWith,
83                    zipWith3,
84                    zipWith4,
85                    zipWith5,
86                    zipWith6,
87                    zipWith7,
88                    unzip,
89                    unzip3,
90                    unzip4,
91                    unzip5,
92                    unzip6,
93                    unzip7 )
94                import PreludeArray (
95                    array,
96                    listArray,
97                    !,
98                    bounds,
99                    indices,
100                    elems,
101                    assocs,
102                    accumArray,
103                    //,
104                    accum,
105                    amap,
106                    ixmap )
107                import PreludeText (
108                    reads,
109                    shows,
110                    show,
111                    read,
112                    showChar,
113                    readLitChar,
114                    showLitChar,
115                    readSigned,
116                    showSigned,
117                    readDec,
118                    showInt,
119                    readFloat,
120                    showFloat )
121                import PreludeIO (
122                    stdin,
123                    stdout,
124                    stderr,
125                    stdecho,
126                    done,
127                    readFile,
128                    writeFile,
129                    appendFile,
130                    readBinFile,
131                    writeBinFile,
132                    appendBinFile,
133                    deleteFile,
134                    statusFile,
135                    readChan,
136                    appendChan,
137                    readBinChan,
138                    appendBinChan,
139                    statusChan,
140                    echo,
141                    getArgs,
142                    getProgName,
143                    getEnv,
144                    setEnv,
145                    abort,
146                    exit,
147                    print,
148                    prints,
149                    interact )
150                instance (Eq a, Eq b) => Eq (a, b)
151                instance (Ord a, Ord b) => Ord (a, b)
152                instance (Ix a, Ix b) => Ix (a, b)
153                instance (Text a, Text b) => Text (a, b)
154                instance (Binary a, Binary b) => Binary (a, b)
155                instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
156                instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
157                instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
158                instance (Text a, Text b, Text c) => Text (a, b, c)
159                instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
160                instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
161                instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
162                instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
163                instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
164                instance (Binary a, Binary b, Binary c, Binary d) => Binary (a,
165                                                                             b,
166                                                                             c,
167                                                                             d)
168                ^ :: (Num b, Integral a) => b -> a -> b
169                ^^ :: (Fractional b, Integral a) => b -> a -> b
170                appendBin :: Bin -> Bin -> Bin
171                asTypeOf :: a -> a -> a
172                atan2 :: RealFloat a => a -> a -> a
173                chr :: Int -> Char
174                fromIntegral :: (Integral a, Num b) => a -> b
175                fromRealFrac :: (RealFrac a, Fractional b) => a -> b
176                gcd :: Integral a => a -> a -> a
177                isAlpha :: Char -> Bool
178                isAlphanum :: Char -> Bool
179                isAscii :: Char -> Bool
180                isControl :: Char -> Bool
181                isDigit :: Char -> Bool
182                isLower :: Char -> Bool
183                isNullBin :: Bin -> Bool
184                isPrint :: Char -> Bool
185                isSpace :: Char -> Bool
186                isUpper :: Char -> Bool
187                lcm :: Integral a => a -> a -> a
188                maxChar :: Char
189                maxInt :: Int
190                minChar :: Char
191                minInt :: Int
192                nullBin :: Bin
193                ord :: Char -> Int
194                subtract :: Num a => a -> a -> a
195                toLower :: Char -> Char
196                toUpper :: Char -> Char
197                until :: (a -> Bool) -> (a -> a) -> a -> a
198                trace :: String -> a -> a
199                % :: Integral a => a -> a -> Ratio a
200                numerator :: Integral a => Ratio a -> a
201                denominator :: Integral a => Ratio a -> a
202                approxRational :: RealFrac a => a -> a -> Rational
203                cis :: RealFloat a => a -> Complex a
204                conjugate :: RealFloat a => Complex a -> Complex a
205                imagPart :: RealFloat a => Complex a -> a
206                magnitude :: RealFloat a => Complex a -> a
207                mkPolar :: RealFloat a => a -> a -> Complex a
208                phase :: RealFloat a => Complex a -> a
209                polar :: RealFloat a => Complex a -> (a, a)
210                realPart :: RealFloat a => Complex a -> a
211                !! :: Integral a => [b] -> a -> b
212                \\ :: Eq a => [a] -> [a] -> [a]
213                all :: (a -> Bool) -> [a] -> Bool
214                and :: [Bool] -> Bool
215                any :: (a -> Bool) -> [a] -> Bool
216                break :: (a -> Bool) -> [a] -> ([a], [a])
217                concat :: [[a]] -> [a]
218                cycle :: [a] -> [a]
219                drop :: Integral a => a -> [b] -> [b]
220                dropWhile :: (a -> Bool) -> [a] -> [a]
221                elem :: Eq a => a -> [a] -> Bool
222                filter :: (a -> Bool) -> [a] -> [a]
223                foldl1 :: (a -> a -> a) -> [a] -> a
224                foldr1 :: (a -> a -> a) -> [a] -> a
225                genericLength :: Num b => [a] -> b
226                head :: [a] -> a
227                init :: [a] -> [a]
228                iterate :: (a -> a) -> a -> [a]
229                last :: [a] -> a
230                length :: [a] -> Int
231                lines :: [Char] -> [[Char]]
232                maximum :: Ord a => [a] -> a
233                minimum :: Ord a => [a] -> a
234                notElem :: Eq a => a -> [a] -> Bool
235                nub :: Eq a => [a] -> [a]
236                null :: [a] -> Bool
237                or :: [Bool] -> Bool
238                partition :: (a -> Bool) -> [a] -> ([a], [a])
239                product :: Num a => [a] -> a
240                products :: Num a => [a] -> [a]
241                repeat :: a -> [a]
242                reverse :: [a] -> [a]
243                scanl :: (b -> a -> b) -> b -> [a] -> [b]
244                scanl1 :: (a -> a -> a) -> [a] -> [a]
245                scanr :: (a -> b -> b) -> b -> [a] -> [b]
246                scanr1 :: (a -> a -> a) -> [a] -> [a]
247                span :: (a -> Bool) -> [a] -> ([a], [a])
248                splitAt :: Integral a => a -> [b] -> ([b], [b])
249                sum :: Num a => [a] -> a
250                sums :: Num a => [a] -> [a]
251                tail :: [a] -> [a]
252                take :: Integral a => a -> [b] -> [b]
253                takeWhile :: (a -> Bool) -> [a] -> [a]
254                transpose :: [[a]] -> [[a]]
255                unlines :: [[Char]] -> [Char]
256                unwords :: [[Char]] -> [Char]
257                unzip :: [(a, b)] -> ([a], [b])
258                unzip3 :: [(a, b, c)] -> ([a], [b], [c])
259                unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
260                unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
261                unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
262                unzip7 ::
263                    [(a, b, c, d, e, f, g)]
264                    -> ([a], [b], [c], [d], [e], [f], [g])
265                words :: [Char] -> [[Char]]
266                zip :: [a] -> [b] -> [(a, b)]
267                zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
268                zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
269                zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
270                zip6 ::
271                    [a]
272                    -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
273                zip7 ::
274                    [a]
275                    -> [b]
276                       -> [c]
277                          -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
278                zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
279                zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
280                zipWith4 ::
281                    (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
282                zipWith5 ::
283                    (a -> b -> c -> d -> e -> f)
284                    -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
285                zipWith6 ::
286                    (a -> b -> c -> d -> e -> f -> g)
287                    -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
288                zipWith7 ::
289                    (a -> b -> c -> d -> e -> f -> g -> h)
290                    -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
291                ! :: Ix a => Array a b -> a -> b
292                // :: Ix a => Array a b -> [Assoc a b] -> Array a b
293                accum ::
294                    Ix b => (c -> a -> c)
295                            -> Array b c -> [Assoc b a] -> Array b c
296                accumArray ::
297                    Ix b => (c -> a -> c)
298                            -> c -> (b, b) -> [Assoc b a] -> Array b c
299                amap :: Ix b => (a -> c) -> Array b a -> Array b c
300                array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
301                assocs :: Ix a => Array a b -> [Assoc a b]
302                bounds :: Ix b => Array b a -> (b, b)
303                elems :: Ix a => Array a b -> [b]
304                indices :: Ix b => Array b a -> [b]
305                ixmap ::
306                    (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
307                listArray :: Ix a => (a, a) -> [b] -> Array a b
308                read :: Text a => [Char] -> a
309                readDec :: Integral a => [Char] -> [(a, [Char])]
310                readFloat :: RealFloat a => [Char] -> [(a, [Char])]
311                readLitChar :: [Char] -> [(Char, [Char])]
312                readSigned ::
313                    Real a => ([Char] -> [(a, [Char])])
314                              -> [Char] -> [(a, [Char])]
315                reads :: Text a => [Char] -> [(a, [Char])]
316                show :: Text a => a -> [Char]
317                showChar :: Char -> [Char] -> [Char]
318                showFloat :: RealFloat a => a -> [Char] -> [Char]
319                showInt :: Integral a => a -> [Char] -> [Char]
320                showLitChar :: Char -> [Char] -> [Char]
321                showSigned ::
322                    Real a => (a -> [Char] -> [Char])
323                              -> Int -> a -> [Char] -> [Char]
324                shows :: Text a => a -> [Char] -> [Char]
325                abort :: IOError -> [Response] -> [Request]
326                appendBinChan ::
327                    [Char]
328                    -> Bin
329                       -> (IOError -> [Response] -> [Request])
330                          -> ([Response] -> [Request]) -> [Response] -> [Request]
331                appendBinFile ::
332                    [Char]
333                    -> Bin
334                       -> (IOError -> [Response] -> [Request])
335                          -> ([Response] -> [Request]) -> [Response] -> [Request]
336                appendChan ::
337                    [Char]
338                    -> [Char]
339                       -> (IOError -> [Response] -> [Request])
340                          -> ([Response] -> [Request]) -> [Response] -> [Request]
341                appendFile ::
342                    [Char]
343                    -> [Char]
344                       -> (IOError -> [Response] -> [Request])
345                          -> ([Response] -> [Request]) -> [Response] -> [Request]
346                binDispatch ::
347                    (IOError -> [Response] -> a)
348                    -> (Bin -> [Response] -> a) -> [Response] -> a
349                deleteFile ::
350                    [Char]
351                    -> (IOError -> [Response] -> [Request])
352                       -> ([Response] -> [Request]) -> [Response] -> [Request]
353                done :: [Response] -> [Request]
354                echo ::
355                    Bool
356                    -> (IOError -> [Response] -> [Request])
357                       -> ([Response] -> [Request]) -> [Response] -> [Request]
358                exit :: IOError -> [Response] -> [Request]
359                getArgs ::
360                    (IOError -> [Response] -> [Request])
361                    -> ([[Char]] -> [Response] -> [Request])
362                       -> [Response] -> [Request]
363                getEnv ::
364                    [Char]
365                    -> (IOError -> [Response] -> [Request])
366                       -> ([Char] -> [Response] -> [Request])
367                          -> [Response] -> [Request]
368                getProgName ::
369                    (IOError -> [Response] -> [Request])
370                    -> ([Char] -> [Response] -> [Request])
371                       -> [Response] -> [Request]
372                interact :: ([Char] -> [Char]) -> [Response] -> [Request]
373                print :: Text a => a -> [Response] -> [Request]
374                prints :: Text a => a -> [Char] -> [Response] -> [Request]
375                readBinChan ::
376                    [Char]
377                    -> (IOError -> [Response] -> [Request])
378                       -> (Bin -> [Response] -> [Request])
379                          -> [Response] -> [Request]
380                readBinFile ::
381                    [Char]
382                    -> (IOError -> [Response] -> [Request])
383                       -> (Bin -> [Response] -> [Request])
384                          -> [Response] -> [Request]
385                readChan ::
386                    [Char]
387                    -> (IOError -> [Response] -> [Request])
388                       -> ([Char] -> [Response] -> [Request])
389                          -> [Response] -> [Request]
390                readFile ::
391                    [Char]
392                    -> (IOError -> [Response] -> [Request])
393                       -> ([Char] -> [Response] -> [Request])
394                          -> [Response] -> [Request]
395                setEnv ::
396                    [Char]
397                    -> [Char]
398                       -> (IOError -> [Response] -> [Request])
399                          -> ([Response] -> [Request]) -> [Response] -> [Request]
400                statusChan ::
401                    [Char]
402                    -> (IOError -> [Response] -> [Request])
403                       -> ([Char] -> [Response] -> [Request])
404                          -> [Response] -> [Request]
405                statusFile ::
406                    [Char]
407                    -> (IOError -> [Response] -> [Request])
408                       -> ([Char] -> [Response] -> [Request])
409                          -> [Response] -> [Request]
410                stdecho :: [Char]
411                stderr :: [Char]
412                stdin :: [Char]
413                stdout :: [Char]
414                strDispatch ::
415                    (IOError -> [Response] -> a)
416                    -> ([Char] -> [Response] -> a) -> [Response] -> a
417                strListDispatch ::
418                    (IOError -> [Response] -> a)
419                    -> ([[Char]] -> [Response] -> a) -> [Response] -> a
420                succDispatch ::
421                    (IOError -> [Response] -> a)
422                    -> ([Response] -> a) -> [Response] -> a
423                writeBinFile ::
424                    [Char]
425                    -> Bin
426                       -> (IOError -> [Response] -> [Request])
427                          -> ([Response] -> [Request]) -> [Response] -> [Request]
428                writeFile ::
429                    [Char]
430                    -> [Char]
431                       -> (IOError -> [Response] -> [Request])
432                          -> ([Response] -> [Request]) -> [Response] -> [Request]
433            -}
434 import OneA {-
435            interface OneA where
436                import OneB ( fB ) renaming (fB to fBa)
437                type SynA = Float
438                data DataAA 
439                data Ord a => DataAB a
440                    = ConAB1 a
441                    | ConAB2
442                    deriving (Text)
443                class Ord a => ClassA a where
444                    clsA :: a -> String
445                instance ClassA Int
446                fA :: a -> a
447            -}
448 renaming (fA to renamedA)
449 import OneB {-
450            interface OneB where
451                fB :: a -> a
452            -}
453          (fB) 
454 import OneC {-
455            interface OneC where
456                fC :: a -> a
457            -}
458         hiding (fC) 
459 import OneC {-
460            interface OneC where
461                fC :: a -> a
462            -}
463         hiding (fC) 
464 renaming (fc to renamedC)
465 infixr 9 .
466 infixr 8 ^
467 infixr 8 ^^
468 infixr 3 &&
469 infixr 2 ||
470 infixr 0 $
471 infixl 9 !
472 infixl 9 //
473 infix  1 :=
474 infix  6 :+
475 infixr 8 **
476 infixl 7 *
477 infixl 7 /
478 infixl 7 `quot`
479 infixl 7 `rem`
480 infixl 7 `div`
481 infixl 7 `mod`
482 infixl 6 +
483 infixl 6 -
484 infix  4 ==
485 infix  4 /=
486 infix  4 <
487 infix  4 <=
488 infix  4 >=
489 infix  4 >
490 infixl 9 !!
491 infix  5 \\
492 infix  4 `elem`
493 infix  4 `notElem`
494 infixl 7 %
495 infix  6 `fixn`
496 infixl 7 +#
497 infixr 8 `fixr`
498 type Pair a b = (a, b)
499 data FooData
500     = FooCon Int
501 data FooDataB
502     = FooConB Double
503 data Eq a => EqTree a
504     = EqLeaf a
505     | EqBranch (EqLeaf a) (EqLeaf a)
506 class Eq a => EqClass a where
507     eqc :: a -> Char
508     eqc x = '?'
509 class Ord a => OrdClass a where
510     orda :: a -> Char
511     ordb :: a -> Char
512     ordc :: a -> Char
513 instance Eq a => EqClass EqTree a where
514     eqc x = 'a'
515 default (Integer, Rational)
516 bindwith :: (OrdClass a, OrdClass b) => a -> b -> b
517 g :: (Num a, Eq b) => Foo a -> [b] -> (a, a, a) -> b
518 {- rec -}
519 fixn x y = x
520 fixl x y = x
521 fixr x y = x
522 singlebind
523     x = x
524 bindwith
525     a b = b
526 reca a = recb a
527 recb a = reca a
528 ~(a, b, c)
529     | nullity b = a
530     | nullity c = a
531     | otherwise = a
532  where
533     {- rec -}
534     nullity = null
535 mat a b c d | foof a b = d
536             | foof a c = d
537             | foof b c = d
538             where
539                 {- rec -}
540                 foof a b = a == b
541 expr a b c d = ((((((((a + ((:) a b)) + (a : b))
542                      + (((1 - 'c') - "abc") - 1.2929999999999999))
543                     + ((\ x y z -> x) 42))
544                    + ((9 *)))
545                   + ((* 8)))
546                  + (case x of
547                       [] | null x -> 99
548                          | otherwise -> 98
549                          | True -> 97
550                          where
551                              {- rec -}
552                              null x = False))
553                 + ([ z | z <- c, isSpace z ]))
554                + (let
555                     {- rec -}
556                     y = foo
557                   in (((((((y + ([1, 2, 3, 4])) + ((4, 3, 2, 1)))
558                           + ((4 :: Num a => a)))
559                          + (if 42 == 42.000000000000000 then 1 else 4))
560                         + ([ 1 ..  ]))
561                        + ([ 2, 4 ..  ]))
562                       + ([ 3 .. 5 ]))
563                      + ([ 4, 8 .. 999 ]))
564 f _
565   x
566   1
567   1.9299999999999999
568   'c'
569   "dog"
570   ~y
571   (z@(Foo a b))
572   (c Bar d)
573   [1, 2]
574   (3, 4)
575   (n+42) = y
576 g x y z = head y
577
578 Enter trace(0):
579 doRenamings:tossing them away
580 Exit  trace(0)
581  
582 Unknown name in export list: FooDataC
583 "read001.hs", line 38: undefined type constructor: EqLeaf
584 "read001.hs", line 38: undefined type constructor: EqLeaf
585 "read001.hs", line 112: undefined type constructor: Foo
586 "read001.hs", line 95: undefined value: x
587 "read001.hs", line 95: undefined value: x
588 "read001.hs", line 95: undefined value: foo
589 "read001.hs", line 107: undefined value: Foo
590 "read001.hs", line 107: undefined value: Bar
591 Fail: Compilation errors found
592
593 ghc: execution of the Haskell compiler had trouble