[project @ 2001-02-20 15:36:55 by simonpj]
[ghc-hetmet.git] / ghc / compiler / basicTypes / Id.lhs
index b907563..13443a9 100644 (file)
@@ -22,9 +22,8 @@ module Id (
        zapFragileIdInfo, zapLamIdInfo,
 
        -- Predicates
-       omitIfaceSigForId, isDeadBinder,
+       isImplicitId, isDeadBinder,
        externallyVisibleId,
-       isIP,
        isSpecPragmaId, isRecordSelector,
        isPrimOpId, isPrimOpId_maybe, isDictFunId,
        isDataConId, isDataConId_maybe, 
@@ -88,8 +87,7 @@ import IdInfo
 import Demand          ( Demand )
 import Name            ( Name, OccName,
                          mkSysLocalName, mkLocalName,
-                         nameIsLocallyDefined,
-                         getOccName, isIPOcc
+                         getOccName
                        ) 
 import OccName         ( UserFS )
 import PrimRep         ( PrimRep )
@@ -161,6 +159,7 @@ mkTemplateLocals tys = zipWith (mkSysLocal SLIT("tpl"))
                               tys
 
 mkTemplateLocalsNum :: Int -> [Type] -> [Id]
+-- The Int gives the starting point for unique allocation
 mkTemplateLocalsNum n tys = zipWith (mkSysLocal SLIT("tpl"))
                               (getNumBuiltinUniques n (length tys))
                               tys
@@ -273,22 +272,13 @@ isLocalId id
 \end{code}
 
 
-omitIfaceSigForId tells whether an Id's info is implied by other declarations,
-so we don't need to put its signature in an interface file, even if it's mentioned
-in some other interface unfolding.
+isImplicitId tells whether an Id's info is implied by other
+declarations, so we don't need to put its signature in an interface
+file, even if it's mentioned in some other interface unfolding.
 
 \begin{code}
-omitIfaceSigForId :: Id -> Bool
-omitIfaceSigForId id
-  = ASSERT2( not (omit && nameIsLocallyDefined (idName id)
-                       && idTyGenInfo id /= TyGenNever),
-             ppr id )
-    -- mustn't omit type signature for a name whose type might change!
-    omit
-  where
-    omit = omitIfaceSigForId' id
-
-omitIfaceSigForId' id
+isImplicitId :: Id -> Bool
+isImplicitId id
   = case idFlavour id of
        RecordSelId _   -> True -- Includes dictionary selectors
         PrimOpId _      -> True
@@ -298,21 +288,13 @@ omitIfaceSigForId' id
                -- remember that all type and class decls appear in the interface file.
                -- The dfun id must *not* be omitted, because it carries version info for
                -- the instance decl
-
-       ConstantId -> False     -- Ordinary Ids
-       DictFunId  -> False
-       
-       ExportedId   -> False   -- I don't think these happen
-       VanillaId    -> False   -- ditto
-       SpecPragmaId -> False   -- ditto
+       other           -> False
 \end{code}
 
 \begin{code}
 isDeadBinder :: Id -> Bool
 isDeadBinder bndr | isId bndr = isDeadOcc (idOccInfo bndr)
                  | otherwise = False   -- TyVars count as not dead
-
-isIP id = isIPOcc (getOccName id)
 \end{code}