From: sof Date: Sat, 23 Jan 1999 18:05:19 +0000 (+0000) Subject: [project @ 1999-01-23 18:05:12 by sof] X-Git-Tag: Approx_2487_patches~2 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c88ecf9ab55e6c261aaf422a4d42b7e065038655;p=ghc-hetmet.git [project @ 1999-01-23 18:05:12 by sof] more h98 updates --- diff --git a/ghc/tests/reader/should_compile/Makefile b/ghc/tests/reader/should_compile/Makefile index 1eb42d5..965c885 100644 --- a/ghc/tests/reader/should_compile/Makefile +++ b/ghc/tests/reader/should_compile/Makefile @@ -2,7 +2,7 @@ TOP = ../.. include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/should_compile.mk -SRC_HC_OPTS += -dcore-lint +SRC_HC_OPTS += -noC -dcore-lint read004_HC_OPTS = -fno-implicit-prelude read012_HC_OPTS += -O -funfold-casms-in-hi-file -fglasgow-exts diff --git a/ghc/tests/reader/should_compile/MyList.hi b/ghc/tests/reader/should_compile/MyList.hi index 7fefb65..fae8c0f 100644 --- a/ghc/tests/reader/should_compile/MyList.hi +++ b/ghc/tests/reader/should_compile/MyList.hi @@ -1,12 +1,6 @@ -_interface_ MyList 1 302 -_instance_modules_ -IO PrelAddr PrelArr PrelBounded PrelCCall PrelForeign PrelNum -_usages_ -PrelBase 3 :: $dEval0 1 $dEval2 1 $dEvalBool0 1 $dEvalDouble0 1 $dEvalInt0 1 Eval 1; -_exports_ -MyList MyList(Empty :::); -_instances_ -instance _forall_ [a] => {PrelBase.Eval (MyList a)} = $dEvalMyList0; -_declarations_ -1 $dEvalMyList0 _:_ _forall_ [a] => {PrelBase.Eval (MyList a)} ;; +__interface MyList 1 0 where +import PrelBase 29 :: addr2Integer 8 foldr 1 int2Integer 8 integer_0 8 integer_1 8 integer_2 8 integer_m1 8; +import PrelPack 28 :: packCString# 1 unpackAppendCString# 1 unpackCString# 1 unpackFoldrCString# 1 unpackNBytes# 9; +__instimport IO ; __instimport PrelAddr ; __instimport PrelArr ; __instimport PrelBounded ; __instimport PrelCCall ; __instimport PrelConc ; __instimport PrelForeign ; __instimport PrelIOBase ; __instimport PrelNum ; __instimport PrelNumExtra ; __instimport PrelTup ; +__export MyList MyList{Empty :::}; 1 data MyList a = Empty | ::: (MyList a) (MyList a) ; diff --git a/ghc/tests/reader/should_compile/read001.hs b/ghc/tests/reader/should_compile/read001.hs index 6b8f86e..d0a84ff 100644 --- a/ghc/tests/reader/should_compile/read001.hs +++ b/ghc/tests/reader/should_compile/read001.hs @@ -1,4 +1,4 @@ ---!!! import qualified Prelude should leave (), [] etc in scope +-- !!! import qualified Prelude should leave (), [] etc in scope module ShouldCompile where diff --git a/ghc/tests/reader/should_compile/read002.hs b/ghc/tests/reader/should_compile/read002.hs index b11f397..0d26eb7 100644 --- a/ghc/tests/reader/should_compile/read002.hs +++ b/ghc/tests/reader/should_compile/read002.hs @@ -1,4 +1,4 @@ ---!!! tests fixity reading and printing +-- !!! tests fixity reading and printing module Reader where infixl 1 `f` diff --git a/ghc/tests/reader/should_compile/read003.hs b/ghc/tests/reader/should_compile/read003.hs index 7b3ef7a..d0e5206 100644 --- a/ghc/tests/reader/should_compile/read003.hs +++ b/ghc/tests/reader/should_compile/read003.hs @@ -1,4 +1,4 @@ ---!!! Testing layout rule +-- !!! Testing layout rule module Layout where l1 :: IO () diff --git a/ghc/tests/reader/should_compile/read005.hs b/ghc/tests/reader/should_compile/read005.hs index a3b91f4..e02b3d0 100644 --- a/ghc/tests/reader/should_compile/read005.hs +++ b/ghc/tests/reader/should_compile/read005.hs @@ -1,2 +1,2 @@ ---!!! Empty comments terminating a file.. +-- !!! Empty comments terminating a file.. main = print "Hello" -- diff --git a/ghc/tests/reader/should_compile/read006.hs b/ghc/tests/reader/should_compile/read006.hs index 036b02f..bb26ed0 100644 --- a/ghc/tests/reader/should_compile/read006.hs +++ b/ghc/tests/reader/should_compile/read006.hs @@ -1,4 +1,4 @@ ---!!! Testing handling of troublesome constructor name (:::) +-- !!! Testing handling of troublesome constructor name (:::) module MyList (MyList(Empty, (:::))) where data MyList a = Empty diff --git a/ghc/tests/reader/should_compile/read008.hs b/ghc/tests/reader/should_compile/read008.hs index ea6032e..12e2bb6 100644 --- a/ghc/tests/reader/should_compile/read008.hs +++ b/ghc/tests/reader/should_compile/read008.hs @@ -1,5 +1,4 @@ module ShouldSucceed where -{-# SPECIALISE f :: Int -> Int -#-} +{-# SPECIALISE f :: Int -> Int #-} f n = n + 1 diff --git a/ghc/tests/reader/should_compile/read009.hs b/ghc/tests/reader/should_compile/read009.hs index a115cb5..588aae8 100644 --- a/ghc/tests/reader/should_compile/read009.hs +++ b/ghc/tests/reader/should_compile/read009.hs @@ -1,4 +1,4 @@ ---!!! combining undeclared infix operators +-- !!! combining undeclared infix operators module ShouldSucceed where -- should default to 'infixl 9' diff --git a/ghc/tests/reader/should_compile/read010.hs b/ghc/tests/reader/should_compile/read010.hs index 097650c..579152b 100644 --- a/ghc/tests/reader/should_compile/read010.hs +++ b/ghc/tests/reader/should_compile/read010.hs @@ -1,5 +1,4 @@ +-- !!! Infix record constructor. module ShouldSucceed where ---!!! Infix record constructor. - data Rec = (:<-:) { a :: Int, b :: Float } diff --git a/ghc/tests/reader/should_compile/read011.hs b/ghc/tests/reader/should_compile/read011.hs index 5b1d7d5..fec644b 100644 --- a/ghc/tests/reader/should_compile/read011.hs +++ b/ghc/tests/reader/should_compile/read011.hs @@ -1,4 +1,4 @@ ---!!! do & where interaction +-- !!! do & where interaction module ShouldSucceed where f1 :: IO a -> IO [a] diff --git a/ghc/tests/reader/should_fail/expr001.stderr b/ghc/tests/reader/should_fail/expr001.stderr index a6d5ef8..169d246 100644 --- a/ghc/tests/reader/should_fail/expr001.stderr +++ b/ghc/tests/reader/should_fail/expr001.stderr @@ -11,3 +11,4 @@ expr001.hs:10: Value not in scope: `c' Compilation had errors + diff --git a/ghc/tests/reader/should_fail/read001.hs b/ghc/tests/reader/should_fail/read001.hs index 79576f8..74704a9 100644 --- a/ghc/tests/reader/should_fail/read001.hs +++ b/ghc/tests/reader/should_fail/read001.hs @@ -1,4 +1,4 @@ ---!!! this module supposedly includes one of each Haskell construct +-- !!! this module supposedly includes one of each Haskell construct -- HsImpExp stuff @@ -14,10 +14,10 @@ module OneOfEverything ( module OneOfEverything ) where -import qualified Prelude +import Prelude import IO ( putStr ) import System hiding ( getArgs ) -import Monad hiding ( filter ) +import Monad -- HsDecls stuff diff --git a/ghc/tests/reader/should_fail/read001.stderr b/ghc/tests/reader/should_fail/read001.stderr index 6cd9d9d..23b140c 100644 --- a/ghc/tests/reader/should_fail/read001.stderr +++ b/ghc/tests/reader/should_fail/read001.stderr @@ -5,16 +5,13 @@ module OneOfEverything ( EqBranch), EqClass(..), OrdClass(orda, ordb), module OneC, module OneOfEverything ) where -import qualified OneA -import OneB (fB) -import OneC hiding (fC) -import OneC hiding (fC) -infix 6 fixn -infixl 7 +# -infixr 8 fixr +import Prelude +import IO (putStr) +import System hiding (getArgs) +import Monad {- rec -} -g :: _forall_ [] (Num a, Eq b) => Foo a -> [b] -> (a, a, a) -> b -bindwith :: _forall_ [] (OrdClass a, OrdClass b) => a -> b -> b +g :: (Num a, Eq b) => Foo a -> [b] -> (a, a, a) -> b +bindwith :: (OrdClass a, OrdClass b) => a -> b -> b fixn x y = x fixl x y = x fixr x y = x @@ -30,37 +27,36 @@ recb a = reca a {- rec -} nullity = null mat a b c d - | foof a b = d - | foof a c = d - | foof b c = d - where - {- rec -} - foof a b = a == b + | foof a b = d + | foof a c = d + | foof b c = d + where + {- rec -} + foof a b = a == b expr a b c d - = ((((((((a + (: a b)) + (a : b)) + (((1 - 'c') - "abc") - 1.293)) - + ((\ x y z -> x) 42)) - + ((9 *))) - + ((* 8))) - + (case x of - Prelude.[] - | null x -> 99 - | otherwise -> 98 - | True -> 97 - where - {- rec -} - null x = False)) - + ([z | z <- c, isSpace z])) - + (let - {- rec -} - y = foo - in - (((((((y + [1, 2, 3, 4]) + (4, 3, 2, 1)) - + (4 :: _forall_ [] (Num a) => a)) - + (if 42 == 42.0 then 1 else 4)) - + ([1 .. ])) - + ([2, 4 .. ])) - + ([3 .. 5])) - + ([4, 8 .. 999])) + = ((((((((a + (: a b)) + (a : b)) + (((1 - 'c') - "abc") - 1.293)) + + ((\ x y z -> x) 42)) + + ((9 *))) + + ((* 8))) + + (case x of + Prelude.[] + | null x -> 99 + | otherwise -> 98 + | True -> 97 + where + {- rec -} + null x = False)) + + ([z | z <- c, isSpace z])) + + (let + {- rec -} + y = foo + in + (((((((y + [1, 2, 3, 4]) + (4, 3, 2, 1)) + (4 :: (Num a) => a)) + + (if 42 == 42.0 then 1 else 4)) + + ([1 .. ])) + + ([2, 4 .. ])) + + ([3 .. 5])) + + ([4, 8 .. 999])) f _ x 1 @@ -73,10 +69,10 @@ f _ [1, 2] (3, 4) ((n+42)) - = y + = y g x y z = head y default (Integer, Rational) -instance _forall_ [] (Eq a) => EqClass (EqTree a) where +instance (Eq a) => EqClass (EqTree a) where [] eqc x = 'a' class (Ord a) => OrdClass a where { @@ -90,20 +86,37 @@ data (Eq a) => EqTree a = EqLeaf a | EqBranch (EqLeaf a) (EqLeaf a) data FooDataB = FooConB Double data FooData = FooCon Int type Pair a b = (a, b) +infixr 8 fixr +infixl 7 +# +infix 6 fixn -read001.hs:17: Could not find valid interface file `OneA' +read001.hs:20: Warning: Unused fixity declaration for `+#' + + +read001.hs:5: Type constructor or class not in scope: `FooDataC' + +read001.hs:5: Unknown module in export list: module `OneC' + +read001.hs:40: Type constructor or class not in scope: `EqLeaf' -read001.hs:18: Could not find valid interface file `OneB' +read001.hs:40: Type constructor or class not in scope: `EqLeaf' -read001.hs:18: Module `OneB' does not export `fB' +read001.hs:80: Value not in scope: `isSpace' -read001.hs:19: Could not find valid interface file `OneC' +read001.hs:87: Value not in scope: `x' -read001.hs:19: Module `OneC' does not export `fC' +read001.hs:87: Value not in scope: `x' -read001.hs:20: Module `OneC' does not export `fC' +read001.hs:95: Value not in scope: `foo' + +read001.hs:107: Data constructor not in scope: `Foo' + +read001.hs:107: Data constructor not in scope: `Bar' + +read001.hs:112: Type constructor or class not in scope: `Foo' Compilation had errors + diff --git a/ghc/tests/reader/should_fail/read003.hs b/ghc/tests/reader/should_fail/read003.hs index a986760..8595312 100644 --- a/ghc/tests/reader/should_fail/read003.hs +++ b/ghc/tests/reader/should_fail/read003.hs @@ -1,4 +1,4 @@ ---!!! Irrefutable patterns + guards +-- !!! Irrefutable patterns + guards module Read003 where ~(a,b,c) | nullity b = a diff --git a/ghc/tests/reader/should_fail/read003.stderr b/ghc/tests/reader/should_fail/read003.stderr index 706a4e1..e4a38a3 100644 --- a/ghc/tests/reader/should_fail/read003.stderr +++ b/ghc/tests/reader/should_fail/read003.stderr @@ -12,18 +12,13 @@ module Read003 where -read003.hs:8: +read003.hs:4: Occurs check: cannot construct the infinite type: - aKy = (aKy, aKB, aKE) - Expected: (aKy, [aKM], aKE) - Inferred: aKy - In a pattern binding: - ~(a, b, c) - | nullity b = a - | nullity c = a - | otherwise = a - where - nullity = null + t = (t, [a], _116) + Expected type: (t, [a], _116) + Inferred type: t + In the right-hand side of a pattern binding: a Compilation had errors + diff --git a/ghc/tests/reader/should_fail/read004.hs b/ghc/tests/reader/should_fail/read004.hs index d02f7f4..f5e1fb4 100644 --- a/ghc/tests/reader/should_fail/read004.hs +++ b/ghc/tests/reader/should_fail/read004.hs @@ -1,5 +1,5 @@ ---!!! string gaps ---!!! +-- !!! string gaps +-- !!! module Main(main) where ----------- diff --git a/ghc/tests/reader/should_fail/read006.hs b/ghc/tests/reader/should_fail/read006.hs index feae50f..fa3d867 100644 --- a/ghc/tests/reader/should_fail/read006.hs +++ b/ghc/tests/reader/should_fail/read006.hs @@ -1,4 +1,4 @@ ---!!! Using pattern syntax on RHS +-- !!! Using pattern syntax on RHS module ShouldFail where f :: Int -> Int diff --git a/ghc/tests/reader/should_fail/read007.hs b/ghc/tests/reader/should_fail/read007.hs index bb9e658..4466f17 100644 --- a/ghc/tests/reader/should_fail/read007.hs +++ b/ghc/tests/reader/should_fail/read007.hs @@ -1,4 +1,4 @@ ---!!! Expressions as patterns inside do stmt blocks +-- !!! Expressions as patterns inside do stmt blocks module ShouldFail where f :: Int -> IO Int