Remove Control.Parallel*, now in package parallel
[haskell-directory.git] / GHC / Err.lhs
index 35b0716..946ca36 100644 (file)
@@ -1,5 +1,5 @@
 \begin{code}
-{-# OPTIONS -fno-implicit-prelude #-}
+{-# OPTIONS_GHC -fno-implicit-prelude #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  GHC.Err
@@ -19,6 +19,7 @@
 -- 
 -----------------------------------------------------------------------------
 
+-- #hide
 module GHC.Err 
        (
          irrefutPatError
@@ -29,8 +30,9 @@ module GHC.Err
        , recConError
        , runtimeError              -- :: Addr#  -> a   -- Addr# points to UTF8 encoded C string
 
-       , absentErr, parError       -- :: a
-       , seqError                  -- :: a
+       , absentErr                -- :: a
+       , divZeroError             -- :: a
+       , overflowError            -- :: a
 
        , error                    -- :: String -> a
        , assertError              -- :: String -> Bool -> a -> a
@@ -52,12 +54,13 @@ import GHC.Exception
 %*********************************************************
 
 \begin{code}
--- error stops execution and displays an error message
+-- | 'error' stops execution and displays an error message.
 error :: String -> a
 error s = throw (ErrorCall s)
 
+-- | A special case of 'error'.
 -- It is expected that compilers will recognize this and insert error
--- messages which are more appropriate to the context in which undefined 
+-- messages which are more appropriate to the context in which 'undefined'
 -- appears. 
 
 undefined :: a
@@ -74,11 +77,9 @@ Used for compiler-generated error message;
 encoding saves bytes of string junk.
 
 \begin{code}
-absentErr, parError, seqError :: a
+absentErr :: a
 
 absentErr = error "Oops! The program has entered an `absent' argument!\n"
-parError  = error "Oops! Entered GHCerr.parError (a GHC bug -- please report it!)\n"
-seqError  = error "Oops! Entered seqError (a GHC bug -- please report it!)\n"
 \end{code}
 
 \begin{code}
@@ -129,3 +130,18 @@ untangle coded message
        }
     not_bar c = c /= '|'
 \end{code}
+
+Divide by zero and arithmetic overflow.
+We put them here because they are needed relatively early
+in the libraries before the Exception type has been defined yet.
+
+\begin{code}
+{-# NOINLINE divZeroError #-}
+divZeroError :: a
+divZeroError = throw (ArithException DivideByZero)
+
+{-# NOINLINE overflowError #-}
+overflowError :: a
+overflowError = throw (ArithException Overflow)
+\end{code}
+