X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FErr.lhs;h=a44e1a5fd8b499678e4cfb90a311d668a99a380e;hb=281853c0c595211e4a56c547f475f1949da46674;hp=35b07163725e7fdd1632b31b0369c8b0cfa84670;hpb=eb5b02e3b6ad1c2affdc8d5a5697f541b2d45fb1;p=ghc-base.git diff --git a/GHC/Err.lhs b/GHC/Err.lhs index 35b0716..a44e1a5 100644 --- a/GHC/Err.lhs +++ b/GHC/Err.lhs @@ -29,8 +29,8 @@ module GHC.Err , recConError , runtimeError -- :: Addr# -> a -- Addr# points to UTF8 encoded C string - , absentErr, parError -- :: a - , seqError -- :: a + , absentErr -- :: a + , divZeroError -- :: a , error -- :: String -> a , assertError -- :: String -> Bool -> a -> a @@ -74,11 +74,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 +127,13 @@ untangle coded message } not_bar c = c /= '|' \end{code} + +Divide by zero. We put it here because it is needed relatively early +in the libraries before the Exception type has been defined yet. + +\begin{code} +{-# NOINLINE divZeroError #-} +divZeroError :: a +divZeroError = throw (ArithException DivideByZero) +\end{code} +