X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypes%2FTyCon.lhs;h=d40619627a2185374231223d0f56075c1e4ccdb8;hb=5cf27e8f1731c52fe63a5b9615f927484164c61b;hp=09dfc13b0ec65d1cc0d81f5740d132840738d30a;hpb=2f51f1402e6869c0f049ffbe7b019bf6ab80558f;p=ghc-hetmet.git diff --git a/ghc/compiler/types/TyCon.lhs b/ghc/compiler/types/TyCon.lhs index 09dfc13..d406196 100644 --- a/ghc/compiler/types/TyCon.lhs +++ b/ghc/compiler/types/TyCon.lhs @@ -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}