[project @ 1999-02-17 21:53:27 by simonpj]
[ghc-hetmet.git] / ghc / compiler / prelude / TysWiredIn.lhs
index 3a2a16f..6088e2d 100644 (file)
@@ -44,7 +44,8 @@ module TysWiredIn (
 
        integerTy,
        integerTyCon,
-       integerDataCon,
+       smallIntegerDataCon,
+       largeIntegerDataCon,
        isIntegerTy,
 
        listTyCon,
@@ -61,10 +62,6 @@ module TysWiredIn (
        unboxedTupleTyCon, unboxedTupleCon, 
        unboxedPairTyCon, unboxedPairDataCon,
 
-       stateDataCon,
-       stateTyCon,
-       realWorldStateTy,
-
        stablePtrTyCon,
        stringTy,
        trueDataCon,
@@ -96,7 +93,7 @@ import TysPrim
 
 -- others:
 import Constants       ( mAX_TUPLE_SIZE )
-import Name            ( Module, varOcc, mkWiredInTyConName, mkWiredInIdName )
+import Name            ( Module, mkWiredInTyConName, mkWiredInIdName, mkSrcOccFS, dataName )
 import DataCon         ( DataCon, mkDataCon )
 import Var             ( TyVar, tyVarKind )
 import TyCon           ( TyCon, mkAlgTyCon, mkSynTyCon, mkTupleTyCon )
@@ -156,7 +153,7 @@ pcDataCon key mod str tyvars context arg_tys tycon
                [ NotMarkedStrict | a <- arg_tys ]
                [ {- no labelled fields -} ]
                tyvars context [] [] arg_tys tycon id
-    name = mkWiredInIdName key mod (varOcc str) id
+    name = mkWiredInIdName key mod (mkSrcOccFS dataName str) id
     id   = mkDataConId data_con
 \end{code}
 
@@ -383,22 +380,12 @@ doubleDataCon = pcDataCon doubleDataConKey pREL_BASE SLIT("D#") [] [] [doublePri
 \end{code}
 
 \begin{code}
-mkStateTy ty    = mkTyConApp stateTyCon [ty]
-realWorldStateTy = mkStateTy realWorldTy -- a common use
-
-stateTyCon = pcNonRecDataTyCon stateTyConKey pREL_ST SLIT("State") alpha_tyvar [stateDataCon]
-stateDataCon
-  = pcDataCon stateDataConKey pREL_ST SLIT("S#")
-       alpha_tyvar [] [mkStatePrimTy alphaTy] stateTyCon
-\end{code}
-
-\begin{code}
 stablePtrTyCon
-  = pcNonRecDataTyCon stablePtrTyConKey pREL_FOREIGN SLIT("StablePtr")
+  = pcNonRecDataTyCon stablePtrTyConKey pREL_STABLE SLIT("StablePtr")
        alpha_tyvar [stablePtrDataCon]
   where
     stablePtrDataCon
-      = pcDataCon stablePtrDataConKey pREL_FOREIGN SLIT("StablePtr")
+      = pcDataCon stablePtrDataConKey pREL_STABLE SLIT("StablePtr")
            alpha_tyvar [] [mkStablePtrPrimTy alphaTy] stablePtrTyCon
 \end{code}
 
@@ -423,10 +410,13 @@ foreignObjTyCon
 integerTy :: Type
 integerTy = mkTyConTy integerTyCon
 
-integerTyCon = pcNonRecDataTyCon integerTyConKey pREL_BASE SLIT("Integer") [] [integerDataCon]
+integerTyCon = pcNonRecDataTyCon integerTyConKey pREL_BASE SLIT("Integer") [] [smallIntegerDataCon, largeIntegerDataCon]
+
+smallIntegerDataCon = pcDataCon smallIntegerDataConKey pREL_BASE SLIT("S#")
+               [] [] [intPrimTy] integerTyCon
+largeIntegerDataCon = pcDataCon largeIntegerDataConKey pREL_BASE SLIT("J#")
+               [] [] [intPrimTy, byteArrayPrimTy] integerTyCon
 
-integerDataCon = pcDataCon integerDataConKey pREL_BASE SLIT("J#")
-               [] [] [intPrimTy, intPrimTy, byteArrayPrimTy] integerTyCon
 
 isIntegerTy :: Type -> Bool
 isIntegerTy ty
@@ -460,7 +450,8 @@ primArgTyConKeys
     , wordTyConKey, word8TyConKey, word16TyConKey, word32TyConKey, word64TyConKey
     , floatTyConKey, doubleTyConKey
     , addrTyConKey, charTyConKey, foreignObjTyConKey
-    , stablePtrTyConKey, byteArrayTyConKey, mutableByteArrayTyConKey
+    , stablePtrTyConKey
+    , byteArrayTyConKey, mutableByteArrayTyConKey
     ]
 
 -- types that can be passed from the outside world into Haskell.