X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fprelude%2FTysPrim.lhs;h=9ba28873754da69a84adb1832bfb79c1b5ed0b99;hb=88e2e9b68aab91a3623902590179615a612aeae1;hp=df43fafed47df491c549b437ff2582a531ec3bab;hpb=1553c7788e7f663bfc55813158325d695a21a229;p=ghc-hetmet.git diff --git a/ghc/compiler/prelude/TysPrim.lhs b/ghc/compiler/prelude/TysPrim.lhs index df43faf..9ba2887 100644 --- a/ghc/compiler/prelude/TysPrim.lhs +++ b/ghc/compiler/prelude/TysPrim.lhs @@ -3,9 +3,6 @@ % \section[TysPrim]{Wired-in knowledge about primitive types} -This module tracks the ``state interface'' document, ``GHC prelude: -types and operations.'' - \begin{code} module TysPrim( alphaTyVars, betaTyVars, alphaTyVar, betaTyVar, gammaTyVar, deltaTyVar, @@ -42,9 +39,7 @@ module TysPrim( word32PrimTyCon, word32PrimTy, int64PrimTyCon, int64PrimTy, - word64PrimTyCon, word64PrimTy, - - primRepTyCon + word64PrimTyCon, word64PrimTy ) where #include "HsVersions.h" @@ -229,11 +224,11 @@ statePrimTyCon = pcPrimTyCon statePrimTyConName vrcsZ VoidRep \end{code} RealWorld is deeply magical. It is *primitive*, but it is not -*unlifted* (hence PrimPtrRep). We never manipulate values of type +*unlifted* (hence PtrRep). We never manipulate values of type RealWorld; it's only used in the type system, to parameterise State#. \begin{code} -realWorldTyCon = mkLiftedPrimTyCon realWorldTyConName liftedTypeKind 0 [] PrimPtrRep +realWorldTyCon = mkLiftedPrimTyCon realWorldTyConName liftedTypeKind 0 [] PtrRep realWorldTy = mkTyConTy realWorldTyCon realWorldStatePrimTy = mkStatePrimTy realWorldTy -- State# RealWorld \end{code} @@ -249,10 +244,10 @@ defined in \tr{TysWiredIn.lhs}, not here. %************************************************************************ \begin{code} -arrayPrimTyCon = pcPrimTyCon arrayPrimTyConName vrcsP ArrayRep -mutableArrayPrimTyCon = pcPrimTyCon mutableArrayPrimTyConName vrcsZP ArrayRep -mutableByteArrayPrimTyCon = pcPrimTyCon mutableByteArrayPrimTyConName vrcsZ ByteArrayRep -byteArrayPrimTyCon = pcPrimTyCon0 byteArrayPrimTyConName ByteArrayRep +arrayPrimTyCon = pcPrimTyCon arrayPrimTyConName vrcsP PtrRep +mutableArrayPrimTyCon = pcPrimTyCon mutableArrayPrimTyConName vrcsZP PtrRep +mutableByteArrayPrimTyCon = pcPrimTyCon mutableByteArrayPrimTyConName vrcsZ PtrRep +byteArrayPrimTyCon = pcPrimTyCon0 byteArrayPrimTyConName PtrRep mkArrayPrimTy elt = mkTyConApp arrayPrimTyCon [elt] byteArrayPrimTy = mkTyConTy byteArrayPrimTyCon @@ -267,7 +262,7 @@ mkMutableByteArrayPrimTy s = mkTyConApp mutableByteArrayPrimTyCon [s] %************************************************************************ \begin{code} -mutVarPrimTyCon = pcPrimTyCon mutVarPrimTyConName vrcsZP PrimPtrRep +mutVarPrimTyCon = pcPrimTyCon mutVarPrimTyConName vrcsZP PtrRep mkMutVarPrimTy s elt = mkTyConApp mutVarPrimTyCon [s, elt] \end{code} @@ -279,7 +274,7 @@ mkMutVarPrimTy s elt = mkTyConApp mutVarPrimTyCon [s, elt] %************************************************************************ \begin{code} -mVarPrimTyCon = pcPrimTyCon mVarPrimTyConName vrcsZP PrimPtrRep +mVarPrimTyCon = pcPrimTyCon mVarPrimTyConName vrcsZP PtrRep mkMVarPrimTy s elt = mkTyConApp mVarPrimTyCon [s, elt] \end{code} @@ -303,7 +298,7 @@ mkStablePtrPrimTy ty = mkTyConApp stablePtrPrimTyCon [ty] %************************************************************************ \begin{code} -stableNamePrimTyCon = pcPrimTyCon stableNamePrimTyConName vrcsP StableNameRep +stableNamePrimTyCon = pcPrimTyCon stableNamePrimTyConName vrcsP PtrRep mkStableNamePrimTy ty = mkTyConApp stableNamePrimTyCon [ty] \end{code} @@ -326,9 +321,9 @@ dead before it really was. \begin{code} foreignObjPrimTy = mkTyConTy foreignObjPrimTyCon -foreignObjPrimTyCon = pcPrimTyCon0 foreignObjPrimTyConName ForeignObjRep +foreignObjPrimTyCon = pcPrimTyCon0 foreignObjPrimTyConName PtrRep \end{code} - + %************************************************************************ %* * \subsection[TysPrim-BCOs]{The ``bytecode object'' type} @@ -337,7 +332,7 @@ foreignObjPrimTyCon = pcPrimTyCon0 foreignObjPrimTyConName ForeignObjRep \begin{code} bcoPrimTy = mkTyConTy bcoPrimTyCon -bcoPrimTyCon = pcPrimTyCon0 bcoPrimTyConName BCORep +bcoPrimTyCon = pcPrimTyCon0 bcoPrimTyConName PtrRep \end{code} %************************************************************************ @@ -347,7 +342,7 @@ bcoPrimTyCon = pcPrimTyCon0 bcoPrimTyConName BCORep %************************************************************************ \begin{code} -weakPrimTyCon = pcPrimTyCon weakPrimTyConName vrcsP WeakPtrRep +weakPrimTyCon = pcPrimTyCon weakPrimTyConName vrcsP PtrRep mkWeakPrimTy v = mkTyConApp weakPrimTyCon [v] \end{code} @@ -369,33 +364,5 @@ to the thread id internally. \begin{code} threadIdPrimTy = mkTyConTy threadIdPrimTyCon -threadIdPrimTyCon = pcPrimTyCon0 threadIdPrimTyConName ThreadIdRep -\end{code} - -%************************************************************************ -%* * -\subsection[TysPrim-PrimRep]{Making types from PrimReps} -%* * -%************************************************************************ - -Each of the primitive types from this module is equivalent to a -PrimRep (see PrimRep.lhs). The following function returns the -primitive TyCon for a given PrimRep. - -\begin{code} -primRepTyCon CharRep = charPrimTyCon -primRepTyCon Int8Rep = charPrimTyCon -primRepTyCon IntRep = intPrimTyCon -primRepTyCon WordRep = wordPrimTyCon -primRepTyCon Int32Rep = int32PrimTyCon -primRepTyCon Int64Rep = int64PrimTyCon -primRepTyCon Word32Rep = word32PrimTyCon -primRepTyCon Word64Rep = word64PrimTyCon -primRepTyCon AddrRep = addrPrimTyCon -primRepTyCon FloatRep = floatPrimTyCon -primRepTyCon DoubleRep = doublePrimTyCon -primRepTyCon StablePtrRep = stablePtrPrimTyCon -primRepTyCon ForeignObjRep = foreignObjPrimTyCon -primRepTyCon WeakPtrRep = weakPrimTyCon -primRepTyCon other = pprPanic "primRepTyCon" (ppr other) +threadIdPrimTyCon = pcPrimTyCon0 threadIdPrimTyConName PtrRep \end{code}