diff --git a/ghc/tests/array/should_run/arr001.hs b/ghc/tests/array/should_run/arr001.hs index 1e42f197967721fd7bd29b3ce71d0722dbfa8dd6..d45d7b8d31f564d5c5cd523d69ed599f6fce9a0f 100644 --- a/ghc/tests/array/should_run/arr001.hs +++ b/ghc/tests/array/should_run/arr001.hs @@ -1,4 +1,4 @@ ---!!! Simple array creation +-- !!! Simple array creation import Array diff --git a/ghc/tests/array/should_run/arr002.hs b/ghc/tests/array/should_run/arr002.hs index 67c5d82b86aa80805a37157ddc3f0387651c6f4f..56505d643795b31cc563751e6370d2614a8ba21d 100644 --- a/ghc/tests/array/should_run/arr002.hs +++ b/ghc/tests/array/should_run/arr002.hs @@ -1,4 +1,4 @@ ---!!! Array creation, (index,value) list with duplicates. +-- !!! Array creation, (index,value) list with duplicates. -- -- Haskell library report 1.3 (and earlier) specifies -- that `array' values created with lists containing dups, diff --git a/ghc/tests/array/should_run/arr003.hs b/ghc/tests/array/should_run/arr003.hs index 06faa313d0f5a5b2c1581d4cba1d52ca4a7f853e..14a99214ebb69db0ebf65d4f5c6510637be4c1e4 100644 --- a/ghc/tests/array/should_run/arr003.hs +++ b/ghc/tests/array/should_run/arr003.hs @@ -1,4 +1,4 @@ ---!!! Array creation, (index,value) list with out of bound index. +-- !!! Array creation, (index,value) list with out of bound index. -- -- Haskell library report 1.3 (and earlier) specifies -- that `array' values created with lists containing out-of-bounds indices, diff --git a/ghc/tests/array/should_run/arr004.hs b/ghc/tests/array/should_run/arr004.hs index f7537d69288af541bb4d6e07202fe4281e938761..cc54395c27feab8af90cbf58ea4f90c1b9f0d0ed 100644 --- a/ghc/tests/array/should_run/arr004.hs +++ b/ghc/tests/array/should_run/arr004.hs @@ -1,4 +1,4 @@ ---!!! Array - accessing undefined element +-- !!! Array - accessing undefined element -- -- Sample Haskell implementation in the 1.3 Lib report defines -- this as being undefined/error. diff --git a/ghc/tests/array/should_run/arr005.hs b/ghc/tests/array/should_run/arr005.hs index 84e4a7615744d90b298fd7854bbc78b5bc90cc3f..62ed12c72e7983a727b8f4f3db8d59912cd10047 100644 --- a/ghc/tests/array/should_run/arr005.hs +++ b/ghc/tests/array/should_run/arr005.hs @@ -1,4 +1,4 @@ ---!!! Array - recurrences +-- !!! Array - recurrences -- -- array does not evaluate the elements. -- diff --git a/ghc/tests/array/should_run/arr006.hs b/ghc/tests/array/should_run/arr006.hs index ff2c561be0e150a17a52c03065e5feca894c0b66..8aa1ddd36872aef967d07cad9a3c091b9a548532 100644 --- a/ghc/tests/array/should_run/arr006.hs +++ b/ghc/tests/array/should_run/arr006.hs @@ -1,4 +1,4 @@ ---!!! Array - empty arrays +-- !!! Array - empty arrays -- -- print a couple of them to try to expose empty arrays -- to a GC or two. diff --git a/ghc/tests/array/should_run/arr007.hs b/ghc/tests/array/should_run/arr007.hs index 2a4d9aece84d5c55e7a16c4dbe08b62ce0d9aaf2..ec0c98376c47faf1df4a96149cd0fd22daee613d 100644 --- a/ghc/tests/array/should_run/arr007.hs +++ b/ghc/tests/array/should_run/arr007.hs @@ -1,4 +1,4 @@ ---!!! Array - accessing empty arrays +-- !!! Array - accessing empty arrays -- -- empty arrays are legal, but indexing them is undefined! -- diff --git a/ghc/tests/array/should_run/arr008.hs b/ghc/tests/array/should_run/arr008.hs index 6b07292759287a91c2e78a9b927ebc9c448eba8c..30d79a6044d55764872a862abf2dd6a10ea39061 100644 --- a/ghc/tests/array/should_run/arr008.hs +++ b/ghc/tests/array/should_run/arr008.hs @@ -1,4 +1,4 @@ ---!!! Array - out-of-range (index,value) pairs +-- !!! Array - out-of-range (index,value) pairs -- -- supplying a list containing one or more pairs -- with out-of-range index is undefined. diff --git a/ghc/tests/array/should_run/arr009.hs b/ghc/tests/array/should_run/arr009.hs index ad9f0a6c2784f11842ac59ae5409a6e8efd5bae3..b45e9e39a3179bca2db6482d177e1b1430914b07 100644 --- a/ghc/tests/array/should_run/arr009.hs +++ b/ghc/tests/array/should_run/arr009.hs @@ -1,4 +1,4 @@ ---!!! Array - derived ops +-- !!! Array - derived ops -- -- testing the well-behavedness of -- derived ops for empty and non-empty arrays diff --git a/ghc/tests/array/should_run/arr010.hs b/ghc/tests/array/should_run/arr010.hs index ead7d65d252cc9663d331493d5af89ba484cf54c..94bf8f3fca2bda25f7d835330f37b02a4417be0b 100644 --- a/ghc/tests/array/should_run/arr010.hs +++ b/ghc/tests/array/should_run/arr010.hs @@ -1,4 +1,4 @@ ---!!! Array - accumulated arrays +-- !!! Array - accumulated arrays -- -- module Main(main) where diff --git a/ghc/tests/array/should_run/arr011.hs b/ghc/tests/array/should_run/arr011.hs index fca26f9d50009df9a66c6fcdfa2b4255320f8364..f4a95d19108066ac762eadd944fe41d90f1843ed 100644 --- a/ghc/tests/array/should_run/arr011.hs +++ b/ghc/tests/array/should_run/arr011.hs @@ -1,4 +1,4 @@ ---!!! Array - array difference operator +-- !!! Array - array difference operator -- -- module Main(main) where diff --git a/ghc/tests/array/should_run/arr012.hs b/ghc/tests/array/should_run/arr012.hs index 98da45efd029b7c0d9e02196f4096ec885f35b68..e0ed3a9d49d25a50dda89b0c8d2d66e859e5520e 100644 --- a/ghc/tests/array/should_run/arr012.hs +++ b/ghc/tests/array/should_run/arr012.hs @@ -1,4 +1,4 @@ ---!!! Array map operations +-- !!! Array map operations -- -- module Main(main) where diff --git a/ghc/tests/array/should_run/arr014.hs b/ghc/tests/array/should_run/arr014.hs index 86996a10d1646976778e2c3e76ed6f2f8cac7558..7efb1b5aa381b25360874e9e278babd5b7ce0cff 100644 --- a/ghc/tests/array/should_run/arr014.hs +++ b/ghc/tests/array/should_run/arr014.hs @@ -1,6 +1,6 @@ {-# OPTIONS -fglasgow-exts #-} ---!!! multi-dimensional arrays +-- !!! multi-dimensional arrays module Main ( main ) where import GlaExts diff --git a/ghc/tests/ccall/should_compile/cc001.hs b/ghc/tests/ccall/should_compile/cc001.hs index 465a4332d5732a7c425d969213af6c49454f2f5f..2c93e8a50ac39cbeea0001c956e6e04438b0c075 100644 --- a/ghc/tests/ccall/should_compile/cc001.hs +++ b/ghc/tests/ccall/should_compile/cc001.hs @@ -1,4 +1,4 @@ ---!!! cc001 -- ccall with standard boxed arguments and results +-- !!! cc001 -- ccall with standard boxed arguments and results module ShouldCompile where diff --git a/ghc/tests/ccall/should_compile/cc002.hs b/ghc/tests/ccall/should_compile/cc002.hs index d3ed1f15db94d4288fd549a8bd915716ca48b8c1..48880c6f8793feac31289e0f3953db9ed3b8e915 100644 --- a/ghc/tests/ccall/should_compile/cc002.hs +++ b/ghc/tests/ccall/should_compile/cc002.hs @@ -1,4 +1,4 @@ ---!!! cc002 -- ccall with ambiguous result (should be defaulted to ()) +-- !!! cc002 -- ccall with ambiguous result (should be defaulted to ()) module ShouldCompile where a :: IO () diff --git a/ghc/tests/ccall/should_compile/cc003.hs b/ghc/tests/ccall/should_compile/cc003.hs index a3dbf78b58357dad013fa271641c7bac8a3aebd9..4ac4c824a2c8149ffbf202ae9baac781274f4419 100644 --- a/ghc/tests/ccall/should_compile/cc003.hs +++ b/ghc/tests/ccall/should_compile/cc003.hs @@ -1,5 +1,5 @@ ---!!! cc003 -- ccall with unresolved polymorphism (should fail) ---!!! not anymore (as of 0.29, result type will default to ()) +-- !!! cc003 -- ccall with unresolved polymorphism (should fail) +-- !!! not anymore (as of 0.29, result type will default to ()) module ShouldCompile where fubar :: IO Int diff --git a/ghc/tests/ccall/should_compile/cc006.hs b/ghc/tests/ccall/should_compile/cc006.hs index 488491f9165c4c82e601f0ece79e56a56902c8e0..374010792b24674c69d3848ed52ce3c5f4da352b 100644 --- a/ghc/tests/ccall/should_compile/cc006.hs +++ b/ghc/tests/ccall/should_compile/cc006.hs @@ -1,4 +1,4 @@ ---!!! cc006 -- ccall with non-standard boxed arguments and results +-- !!! cc006 -- ccall with non-standard boxed arguments and results module Test where diff --git a/ghc/tests/ccall/should_fail/cc001.hs b/ghc/tests/ccall/should_fail/cc001.hs index f0dd58c8ff75b751f28122d22422698fbcb755d9..4019f61782190df74013a14e806e486f71cc1ff8 100644 --- a/ghc/tests/ccall/should_fail/cc001.hs +++ b/ghc/tests/ccall/should_fail/cc001.hs @@ -1,4 +1,4 @@ ---!!! cc002 -- ccall with ambiguous argument +-- !!! cc002 -- ccall with ambiguous argument module Test where f :: IO () diff --git a/ghc/tests/ccall/should_fail/cc002.hs b/ghc/tests/ccall/should_fail/cc002.hs index 7dbbf7297e6ddc73ed09be9044a1df02a0563fe9..36d6a7769189fe2c2c318f758cde85891dbd04cf 100644 --- a/ghc/tests/ccall/should_fail/cc002.hs +++ b/ghc/tests/ccall/should_fail/cc002.hs @@ -1,4 +1,4 @@ ---!!! cc002 -- ccall with non-standard boxed arguments and results +-- !!! cc002 -- ccall with non-standard boxed arguments and results module Test where diff --git a/ghc/tests/ccall/should_fail/cc004.hs b/ghc/tests/ccall/should_fail/cc004.hs index eded2ff65c92abf871f0f0eb1ee770655b8b5e5a..6f7207f979639c7127ef024549bafced6a48698d 100644 --- a/ghc/tests/ccall/should_fail/cc004.hs +++ b/ghc/tests/ccall/should_fail/cc004.hs @@ -1,4 +1,4 @@ ---!!! cc004 -- ccall with synonyms, polymorphic type variables and user type variables. +-- !!! cc004 -- ccall with synonyms, polymorphic type variables and user type variables. module Test where -- Since I messed up the handling of polymorphism originally, I'll diff --git a/ghc/tests/deriving/should_compile/drv001.hs b/ghc/tests/deriving/should_compile/drv001.hs index ffe8196c8f7162c946ffd2967503acbc7e123356..694af6a50f9c1a14b1394dc236525a02e6c41357 100644 --- a/ghc/tests/deriving/should_compile/drv001.hs +++ b/ghc/tests/deriving/should_compile/drv001.hs @@ -1,4 +1,4 @@ ---!!! canonical weird example for "deriving" +-- !!! canonical weird example for "deriving" module ShouldSucceed where data X a b diff --git a/ghc/tests/deriving/should_compile/drv003.hs b/ghc/tests/deriving/should_compile/drv003.hs index f6d678006a63b3cec9eab06901f137cd4e6af2aa..0b8149ce8a097db30af89208ff9ad424a01beca6 100644 --- a/ghc/tests/deriving/should_compile/drv003.hs +++ b/ghc/tests/deriving/should_compile/drv003.hs @@ -1,4 +1,4 @@ ---!!! This is the example given in TcDeriv +-- !!! This is the example given in TcDeriv -- module ShouldSucceed where diff --git a/ghc/tests/deriving/should_compile/drv004.hs b/ghc/tests/deriving/should_compile/drv004.hs index 5c095ddeef75dc778417a9dda409b71ca5cdea8d..324a7f81d449164580624dfeb668559f7face8f7 100644 --- a/ghc/tests/deriving/should_compile/drv004.hs +++ b/ghc/tests/deriving/should_compile/drv004.hs @@ -1,4 +1,4 @@ ---!!! simple example of deriving Ord and Eq simultaneously +-- !!! simple example of deriving Ord and Eq simultaneously -- module ShouldSucceed where diff --git a/ghc/tests/deriving/should_compile/drv005.hs b/ghc/tests/deriving/should_compile/drv005.hs index 93d8b45e0e00864faca96f003e845448737a07ab..527dde98b9921af90b945465ec402dbb7d6f2d6b 100644 --- a/ghc/tests/deriving/should_compile/drv005.hs +++ b/ghc/tests/deriving/should_compile/drv005.hs @@ -1,4 +1,4 @@ ---!!! simple example of deriving Enum +-- !!! simple example of deriving Enum -- module ShouldSucceed where diff --git a/ghc/tests/deriving/should_compile/drv006.hs b/ghc/tests/deriving/should_compile/drv006.hs index b21d9f22fb6def117c37f6743e5b023fc564ab62..d2a88fd106ffdacaa2ac77ee61a7d0e4ef1f3a9f 100644 --- a/ghc/tests/deriving/should_compile/drv006.hs +++ b/ghc/tests/deriving/should_compile/drv006.hs @@ -1,4 +1,4 @@ ---!!! simple examples of deriving Ix +-- !!! simple examples of deriving Ix -- module ShouldSucceed where import Ix diff --git a/ghc/tests/deriving/should_compile/drv007.hs b/ghc/tests/deriving/should_compile/drv007.hs index feb7297156f50e3158d248df97efed51b2b74825..22da5b4aa3497c0f2571d3896ddbf5bc6a2038cf 100644 --- a/ghc/tests/deriving/should_compile/drv007.hs +++ b/ghc/tests/deriving/should_compile/drv007.hs @@ -1,4 +1,4 @@ ---!!! deriving Ord on d. type with a single nullary constructor. +-- !!! deriving Ord on d. type with a single nullary constructor. -- (from ghc-2.10 panic - as reported by Sergey Mechveliani <mechvel@botik.ru>) -- module ShouldSucceed where diff --git a/ghc/tests/deriving/should_compile/drv008.hs b/ghc/tests/deriving/should_compile/drv008.hs index c06332e26e3b4685bf6ea50ede22d4f96be16a77..c374193777f04e9b15c93b495a9f4a0f6bc734d9 100644 --- a/ghc/tests/deriving/should_compile/drv008.hs +++ b/ghc/tests/deriving/should_compile/drv008.hs @@ -1,4 +1,4 @@ ---!!! deriving Ix on d. type with nullary constructors +-- !!! deriving Ix on d. type with nullary constructors module ShouldSucceed where import Ix diff --git a/ghc/tests/deriving/should_compile/drv009.hs b/ghc/tests/deriving/should_compile/drv009.hs index 4d192788ba56c48c2d51b276e98e55e6ba939ff0..10e889e9292fe1778eb544ae2e2c1f1242c05a9f 100644 --- a/ghc/tests/deriving/should_compile/drv009.hs +++ b/ghc/tests/deriving/should_compile/drv009.hs @@ -1,4 +1,4 @@ ---!!! deriving Ix on d. type with one constructor +-- !!! deriving Ix on d. type with one constructor module ShouldSucceed where import Ix diff --git a/ghc/tests/deriving/should_compile/drv010.hs b/ghc/tests/deriving/should_compile/drv010.hs index e6814507990f51dc9998e2cd4c2e879b4fcb4bc1..1a3f9dc33acaff51c9a7292614722153f9e4dc3f 100644 --- a/ghc/tests/deriving/should_compile/drv010.hs +++ b/ghc/tests/deriving/should_compile/drv010.hs @@ -1,4 +1,4 @@ ---!!! deriving Enum on d. type with nullary constructors +-- !!! deriving Enum on d. type with nullary constructors module ShouldSucceed where data AD = A | B | C | D deriving (Enum) diff --git a/ghc/tests/deriving/should_fail/drvfail004.hs b/ghc/tests/deriving/should_fail/drvfail004.hs index cbdd96f29c46e845a5c640791a60225cbc9e96a7..6e090d8fe173f70a159228d82e53345940c5e7ef 100644 --- a/ghc/tests/deriving/should_fail/drvfail004.hs +++ b/ghc/tests/deriving/should_fail/drvfail004.hs @@ -1,4 +1,4 @@ ---!!! deriving Ord without deriving Eq +-- !!! deriving Ord without deriving Eq -- module ShouldFail where diff --git a/ghc/tests/deriving/should_fail/drvfail007.hs b/ghc/tests/deriving/should_fail/drvfail007.hs index 87efc246c9dbb9913a857a1a9338dc20e1b62006..74f9f033d3c3e9df8ce147daed734b4896b04566 100644 --- a/ghc/tests/deriving/should_fail/drvfail007.hs +++ b/ghc/tests/deriving/should_fail/drvfail007.hs @@ -1,4 +1,4 @@ ---!!! buggy deriving with function type, reported by Sigbjorn Finne +-- !!! buggy deriving with function type, reported by Sigbjorn Finne module ShouldFail where data Foo = Foo (Int -> Int) deriving Eq diff --git a/ghc/tests/typecheck/should_run/tcrun004.hs b/ghc/tests/typecheck/should_run/tcrun004.hs new file mode 100644 index 0000000000000000000000000000000000000000..d2047588670693e1fa672c8f15cee89a5a41bd42 --- /dev/null +++ b/ghc/tests/typecheck/should_run/tcrun004.hs @@ -0,0 +1,72 @@ +-- Originally from Kevin Glynn +-- Tests existential data types + +module Main where + +data Coordinate3D = Coord3D {cx, cy, cz::Double} + deriving (Eq, Show) + +-- We Represent a line by two coordinates which it passes through. +data Line = MkLine Coordinate3D Coordinate3D + + +class PictureObject pot where + + -- Returns ordered (rel to 0 0 0) of points where the object + -- intersects the given line. + intersectLineObject :: pot -> Line -> [Coordinate3D] + + getPictureName :: pot -> String + +data Sphere = + Sphere Coordinate3D -- Centre + Double -- Radius + Double -- ambient coeff + Double -- diffuse coeff + Double -- specular coeff + Double -- phong specular exponent + +intersectLineSphere :: Sphere -> Line -> [Coordinate3D] +intersectLineSphere sp line = [] + +instance PictureObject Sphere where + intersectLineObject = intersectLineSphere + getPictureName _ = "Sphere" + +data Cube = + Cube Coordinate3D -- Origin corner + Coordinate3D -- Opposite corner + Double -- ambient coeff + Double -- diffuse coeff + Double -- specular coeff + Double -- phong specular exponent + deriving (Eq, Show) + +intersectLineCube :: Cube -> Line -> [Coordinate3D] +intersectLineCube cube line = [] + +instance PictureObject Cube where + intersectLineObject = intersectLineCube + getPictureName _ = "Cube" + + +data GenPic = forall pot. (PictureObject pot) => MkGenPic pot + +sphere :: Sphere +sphere = Sphere (Coord3D 1 1 1) 1 1 1 1 1 + +cube :: Cube +cube = Cube (Coord3D 1 1 1) (Coord3D 2 2 2) 1 1 1 1 + +obj_list:: [GenPic] +obj_list = [MkGenPic sphere, MkGenPic cube] + +putName :: PictureObject pot => pot -> IO () +putName x = putStr $ getPictureName x + + +main :: IO () +main = do { sequence $ map put_it obj_list } + where + put_it (MkGenPic s) = putStr (getPictureName s) +