Fix Trac #959: a long-standing bug in instantiating otherwise-unbound type variables
[ghc-hetmet.git] / compiler / prelude / PrelNames.lhs
index 513d81b..bc08660 100644 (file)
@@ -235,9 +235,9 @@ pRELUDE :: Module
 pRELUDE                = mkBaseModule_ pRELUDE_NAME
 
 gHC_PRIM, gHC_TYPES, gHC_BOOL, gHC_UNIT, gHC_ORDERING, gHC_GENERICS, gHC_CLASSES, gHC_BASE, gHC_ENUM,
-    gHC_SHOW, gHC_READ, gHC_NUM, gHC_INTEGER, gHC_INTEGER_INTERNALS, gHC_LIST, gHC_PARR,
+    gHC_SHOW, gHC_READ, gHC_NUM, gHC_INTEGER, gHC_INTEGER_TYPE, gHC_LIST, gHC_PARR,
     gHC_TUPLE, dATA_TUPLE, dATA_EITHER, dATA_STRING, dATA_FOLDABLE, dATA_TRAVERSABLE,
-    gHC_PACK, gHC_CONC, gHC_IO_BASE,
+    gHC_PACK, gHC_CONC, gHC_IO, gHC_IO_Exception,
     gHC_ST, gHC_ARR, gHC_STABLE, gHC_ADDR, gHC_PTR, gHC_ERR, gHC_REAL,
     gHC_FLOAT, gHC_TOP_HANDLER, sYSTEM_IO, dYNAMIC, tYPEABLE, gENERICS,
     dOTNET, rEAD_PREC, lEX, gHC_INT, gHC_WORD, mONAD, mONAD_FIX, aRROW, cONTROL_APPLICATIVE,
@@ -255,7 +255,7 @@ gHC_SHOW    = mkBaseModule (fsLit "GHC.Show")
 gHC_READ       = mkBaseModule (fsLit "GHC.Read")
 gHC_NUM                = mkBaseModule (fsLit "GHC.Num")
 gHC_INTEGER    = mkIntegerModule (fsLit "GHC.Integer")
-gHC_INTEGER_INTERNALS = mkIntegerModule (fsLit "GHC.Integer.Internals")
+gHC_INTEGER_TYPE       = mkIntegerModule (fsLit "GHC.Integer.Type")
 gHC_LIST       = mkBaseModule (fsLit "GHC.List")
 gHC_PARR       = mkBaseModule (fsLit "GHC.PArr")
 gHC_TUPLE      = mkPrimModule (fsLit "GHC.Tuple")
@@ -266,7 +266,8 @@ dATA_FOLDABLE       = mkBaseModule (fsLit "Data.Foldable")
 dATA_TRAVERSABLE= mkBaseModule (fsLit "Data.Traversable")
 gHC_PACK       = mkBaseModule (fsLit "GHC.Pack")
 gHC_CONC       = mkBaseModule (fsLit "GHC.Conc")
-gHC_IO_BASE    = mkBaseModule (fsLit "GHC.IOBase")
+gHC_IO         = mkBaseModule (fsLit "GHC.IO")
+gHC_IO_Exception = mkBaseModule (fsLit "GHC.IO.Exception")
 gHC_ST         = mkBaseModule (fsLit "GHC.ST")
 gHC_ARR                = mkBaseModule (fsLit "GHC.Arr")
 gHC_STABLE     = mkBaseModule (fsLit "GHC.Stable")
@@ -633,14 +634,15 @@ sndName             = varQual dATA_TUPLE (fsLit "snd") sndIdKey
 
 -- Module PrelNum
 numClassName, fromIntegerName, minusName, negateName, plusIntegerName,
-    timesIntegerName, integerTyConName, smallIntegerName :: Name
+    timesIntegerName,
+    integerTyConName, smallIntegerName :: Name
 numClassName     = clsQual  gHC_NUM (fsLit "Num") numClassKey
 fromIntegerName   = methName gHC_NUM (fsLit "fromInteger") fromIntegerClassOpKey
 minusName        = methName gHC_NUM (fsLit "-") minusClassOpKey
 negateName       = methName gHC_NUM (fsLit "negate") negateClassOpKey
 plusIntegerName   = varQual  gHC_INTEGER (fsLit "plusInteger") plusIntegerIdKey
 timesIntegerName  = varQual  gHC_INTEGER (fsLit "timesInteger") timesIntegerIdKey
-integerTyConName  = tcQual   gHC_INTEGER_INTERNALS (fsLit "Integer") integerTyConKey
+integerTyConName  = tcQual   gHC_INTEGER_TYPE (fsLit "Integer") integerTyConKey
 smallIntegerName = varQual gHC_INTEGER (fsLit "smallInteger") smallIntegerIdKey
 
 -- PrelReal types and classes
@@ -689,7 +691,7 @@ dataClassName = clsQual gENERICS (fsLit "Data") dataClassKey
 
 -- Error module
 assertErrorName    :: Name
-assertErrorName          = varQual gHC_IO_BASE (fsLit "assertError") assertErrorIdKey
+assertErrorName          = varQual gHC_IO_Exception (fsLit "assertError") assertErrorIdKey
 
 -- Enum module (Enum, Bounded)
 enumClassName, enumFromName, enumFromToName, enumFromThenName,
@@ -735,15 +737,15 @@ toPName             = varQual gHC_PARR (fsLit "toP")               toPIdKey
 emptyPName        = varQual gHC_PARR (fsLit "emptyP")            emptyPIdKey
 appPName          = varQual gHC_PARR (fsLit "+:+")               appPIdKey
 
--- IOBase things
+-- IO things
 ioTyConName, ioDataConName, thenIOName, bindIOName, returnIOName,
     failIOName :: Name
-ioTyConName      = tcQual  gHC_IO_BASE (fsLit "IO") ioTyConKey
-ioDataConName     = conName gHC_IO_BASE (fsLit "IO") ioDataConKey
-thenIOName       = varQual gHC_IO_BASE (fsLit "thenIO") thenIOIdKey
-bindIOName       = varQual gHC_IO_BASE (fsLit "bindIO") bindIOIdKey
-returnIOName     = varQual gHC_IO_BASE (fsLit "returnIO") returnIOIdKey
-failIOName       = varQual gHC_IO_BASE (fsLit "failIO") failIOIdKey
+ioTyConName      = tcQual  gHC_TYPES (fsLit "IO") ioTyConKey
+ioDataConName     = conName gHC_TYPES (fsLit "IO") ioDataConKey
+thenIOName       = varQual gHC_BASE (fsLit "thenIO") thenIOIdKey
+bindIOName       = varQual gHC_BASE (fsLit "bindIO") bindIOIdKey
+returnIOName     = varQual gHC_BASE (fsLit "returnIO") returnIOIdKey
+failIOName       = varQual gHC_IO (fsLit "failIO") failIOIdKey
 
 -- IO things
 printName :: Name
@@ -921,7 +923,8 @@ addrPrimTyConKey, arrayPrimTyConKey, boolTyConKey, byteArrayPrimTyConKey,
     listTyConKey, foreignObjPrimTyConKey, weakPrimTyConKey,
     mutableArrayPrimTyConKey, mutableByteArrayPrimTyConKey,
     orderingTyConKey, mVarPrimTyConKey, ratioTyConKey, rationalTyConKey,
-    realWorldTyConKey, stablePtrPrimTyConKey, stablePtrTyConKey :: Unique
+    realWorldTyConKey, stablePtrPrimTyConKey, stablePtrTyConKey,
+    anyTyConKey :: Unique
 addrPrimTyConKey                       = mkPreludeTyConUnique  1
 arrayPrimTyConKey                      = mkPreludeTyConUnique  3
 boolTyConKey                           = mkPreludeTyConUnique  4
@@ -954,10 +957,7 @@ rationalTyConKey                   = mkPreludeTyConUnique 33
 realWorldTyConKey                      = mkPreludeTyConUnique 34
 stablePtrPrimTyConKey                  = mkPreludeTyConUnique 35
 stablePtrTyConKey                      = mkPreludeTyConUnique 36
-
-anyPrimTyConKey, anyPrimTyCon1Key :: Unique
-anyPrimTyConKey                                = mkPreludeTyConUnique 37
-anyPrimTyCon1Key                       = mkPreludeTyConUnique 38
+anyTyConKey                            = mkPreludeTyConUnique 37
 
 statePrimTyConKey, stableNamePrimTyConKey, stableNameTyConKey,
     mutVarPrimTyConKey, ioTyConKey,
@@ -1062,7 +1062,7 @@ unitTyConKey = mkTupleTyConUnique Boxed 0
 charDataConKey, consDataConKey, doubleDataConKey, falseDataConKey,
     floatDataConKey, intDataConKey, nilDataConKey, ratioDataConKey,
     stableNameDataConKey, trueDataConKey, wordDataConKey,
-    ioDataConKey :: Unique
+    ioDataConKey, integerDataConKey :: Unique
 charDataConKey                         = mkPreludeDataConUnique  1
 consDataConKey                         = mkPreludeDataConUnique  2
 doubleDataConKey                       = mkPreludeDataConUnique  3
@@ -1075,6 +1075,7 @@ stableNameDataConKey                      = mkPreludeDataConUnique 14
 trueDataConKey                         = mkPreludeDataConUnique 15
 wordDataConKey                         = mkPreludeDataConUnique 16
 ioDataConKey                           = mkPreludeDataConUnique 17
+integerDataConKey                      = mkPreludeDataConUnique 18
 
 -- Generic data constructors
 crossDataConKey, inlDataConKey, inrDataConKey, genUnitDataConKey :: Unique