[project @ 2002-08-30 14:29:51 by simonpj]
authorsimonpj <unknown>
Fri, 30 Aug 2002 14:29:52 +0000 (14:29 +0000)
committersimonpj <unknown>
Fri, 30 Aug 2002 14:29:52 +0000 (14:29 +0000)
* Do not export built-in syntax (H98 conformance)
* Add 'assert' to GHC.Base

(no need to merge to stable branch)

GHC/Base.lhs
GHC/List.lhs
GHC/PArr.hs
Prelude.hs

index 6a307fd..e3bc346 100644 (file)
@@ -86,7 +86,7 @@ Other Prelude modules are much easier with fewer complex dependencies.
 module GHC.Base
        (
        module GHC.Base,
-       module GHC.Prim,                -- Re-export GHC.Prim and GHC.Err, to avoid lots
+       module GHC.Prim,        -- Re-export GHC.Prim and GHC.Err, to avoid lots
        module GHC.Err          -- of people having to import it explicitly
   ) 
        where
@@ -595,6 +595,11 @@ id x                       =  x
 lazy :: a -> a
 lazy x = x
 
+-- Assertion function. This simply ignores its boolean argument.
+-- The compiler may rewrite it to (assertError line)
+assert :: Bool -> a -> a
+assert pred r = r
 -- constant function
 const                  :: a -> b -> a
 const x _              =  x
index 426fad0..99c1b5b 100644 (file)
@@ -15,7 +15,7 @@
 -----------------------------------------------------------------------------
 
 module GHC.List (
-   [] (..),
+   -- [] (..),         -- Not Haskell 98; built in syntax
 
    map, (++), filter, concat,
    head, last, tail, init, null, length, (!!), 
index 7e0f732..a1e3deb 100644 (file)
@@ -72,7 +72,7 @@
 --
 
 module GHC.PArr (
-  [::],                        -- abstract
+  -- [::],             -- Built-in syntax
 
   mapP,                        -- :: (a -> b) -> [:a:] -> [:b:]
   (+:+),               -- :: [:a:] -> [:a:] -> [:a:]
index b833edb..60ae545 100644 (file)
@@ -24,12 +24,12 @@ module Prelude (
     Ordering(..), 
     Char, String, Int, Integer, Float, Double, IO,
     Rational,
-    []((:), []),
+    -- []((:), []),    -- Not legal Haskell 98; available through built-in syntax
     
     module Data.Tuple,
         -- Includes tuple types + fst, snd, curry, uncurry
-    ()(..),            -- The unit type
-    (->),              -- functions
+    -- ()(..),         -- Not legal Haskell 98
+    -- (->),           -- ... available through built-in syntax
     
     -- * Basic type classes
     Eq(..),