[project @ 1996-05-16 09:42:08 by partain]
[ghc-hetmet.git] / ghc / compiler / types / TyCon.lhs
index 09dfc13..d406196 100644 (file)
@@ -12,7 +12,7 @@ module TyCon(
        Arity(..), NewOrData(..),
 
        isFunTyCon, isPrimTyCon, isBoxedTyCon,
-       isDataTyCon, isSynTyCon,
+       isDataTyCon, isSynTyCon, isNewTyCon,
 
        mkDataTyCon,
        mkFunTyCon,
@@ -54,9 +54,11 @@ import Name          ( Name, RdrName(..), appendRdr, nameUnique,
                          mkTupleTyConName, mkFunTyConName
                        )
 import Unique          ( Unique, funTyConKey, mkTupleTyConUnique )
+import PrelInfo                ( intDataCon, charDataCon )
 import Pretty          ( Pretty(..), PrettyRep )
 import PprStyle                ( PprStyle )
 import SrcLoc          ( SrcLoc, mkBuiltinSrcLoc )
+import Unique          ( intDataConKey, charDataConKey )
 import Util            ( panic, panic#, nOfThem, isIn, Ord3(..) )
 \end{code}
 
@@ -145,8 +147,12 @@ isBoxedTyCon = not . isPrimTyCon
 -- isDataTyCon returns False for @newtype@.
 -- Not sure about this decision yet.
 isDataTyCon (DataTyCon _ _ _ _ _ _ _ DataType) = True
+isDataTyCon (TupleTyCon _ _ _)                = True
 isDataTyCon other                             = False
 
+isNewTyCon (DataTyCon _ _ _ _ _ _ _ NewType) = True 
+isNewTyCon other                            = False
+
 isSynTyCon (SynTyCon _ _ _ _ _ _) = True
 isSynTyCon _                     = False
 \end{code}
@@ -229,7 +235,7 @@ tyConFamilySize (TupleTyCon _ _ _)              = 1
 \begin{code}
 tyConDerivings :: TyCon -> [Class]
 tyConDerivings (DataTyCon _ _ _ _ _ _ derivs _) = derivs
-tyConDerivings other                              = []
+tyConDerivings other                           = []
 \end{code}
 
 \begin{code}
@@ -317,11 +323,12 @@ instance Ord TyCon where
     _tagCmp a b = case (a `cmp` b) of { LT_ -> _LT; EQ_ -> _EQ; GT__ -> _GT }
 
 instance Uniquable TyCon where
-    uniqueOf (DataTyCon u _ _ _ _ _ _ _) = u
-    uniqueOf (PrimTyCon u _ _)          = u
-    uniqueOf (SynTyCon  u _ _ _ _ _)    = u
-    uniqueOf tc@(SpecTyCon _ _)                 = panic "uniqueOf:SpecTyCon"
-    uniqueOf tc                                 = uniqueOf (getName tc)
+    uniqueOf (DataTyCon  u _ _ _ _ _ _ _) = u
+    uniqueOf (TupleTyCon u _ _)                  = u
+    uniqueOf (PrimTyCon  u _ _)                  = u
+    uniqueOf (SynTyCon   u _ _ _ _ _)    = u
+    uniqueOf tc@(SpecTyCon _ _)                  = panic "uniqueOf:SpecTyCon"
+    uniqueOf tc                                  = uniqueOf (getName tc)
 \end{code}
 
 \begin{code}