Before this patch, GHC/Err.lhs-boot exported divZeroError and overflowError,
as well as plain 'error'. The latter has a wired-in defn in GHC (MkId.lhs),
but the former two do not. As a result GHC doesn't see that overflowError
is a bottoming function at a crucial moment when compiling GHC.Real, and
that means that divMod wasn't getting the CPR property.
The fix is easy:
- GHC/Err.lhs-boot should export only 'error'
- GHC.Real, GHC.Int, and GHC.Word should import GHC.Err
directly. They can do this nowadays without creating
a module loop, thanks to the new exception story
-- Ghc.Err.hs-boot
---------------------------------------------------------------------------
-module GHC.Err( error, divZeroError, overflowError ) where
+module GHC.Err( error ) where
-- The type signature for 'error' is a gross hack.
-- First, we can't give an accurate type for error, because it mentions
-- to mention 'error' so that it gets exported from this .hi-boot
-- file.
error :: a
-
--- divide by zero is needed quite early
-divZeroError :: a
-
--- overflow is needed quite early
-overflowError :: a
\end{code}
import GHC.Real
import GHC.Read
import GHC.Arr
+import GHC.Err
import GHC.Word hiding (uncheckedShiftL64#, uncheckedShiftRL64#)
import GHC.Show
import GHC.List
import GHC.Enum
import GHC.Show
+import GHC.Err
infixr 8 ^, ^^
infixl 7 /, `quot`, `rem`, `div`, `mod`
import GHC.Read
import GHC.Arr
import GHC.Show
+import GHC.Err
------------------------------------------------------------------------
-- Helper functions