[project @ 2002-07-16 12:05:37 by simonmar]
[ghc-hetmet.git] / ghc / compiler / basicTypes / Id.lhs
index b1a4a1a..45b8b42 100644 (file)
@@ -46,7 +46,6 @@ module Id (
        setIdArity,
        setIdNewDemandInfo, 
        setIdNewStrictness, zapIdNewStrictness,
-        setIdTyGenInfo,
        setIdWorkerInfo,
        setIdSpecialisation,
        setIdCgInfo,
@@ -62,9 +61,8 @@ module Id (
 #endif
 
        idArity, 
-       idNewDemandInfo,
+       idNewDemandInfo, idNewDemandInfo_maybe,
        idNewStrictness, idNewStrictness_maybe, 
-        idTyGenInfo,
        idWorkerInfo,
        idUnfolding,
        idSpecialisation, idCoreRules,
@@ -99,12 +97,12 @@ import Type         ( Type, typePrimRep, addFreeTyVars,
 import IdInfo 
 
 import qualified Demand        ( Demand )
-import NewDemand       ( Demand, StrictSig, topSig, isBottomingSig )
+import NewDemand       ( Demand, StrictSig, topDmd, topSig, isBottomingSig )
 import Name            ( Name, OccName,
                          mkSystemName, mkInternalName,
                          getOccName, getSrcLoc
                        ) 
-import OccName         ( EncodedFS, UserFS, mkWorkerOcc )
+import OccName         ( EncodedFS, mkWorkerOcc )
 import PrimRep         ( PrimRep )
 import TysPrim         ( statePrimTyCon )
 import FieldLabel      ( FieldLabel )
@@ -118,7 +116,6 @@ infixl      1 `setIdUnfolding`,
          `setIdArity`,
          `setIdNewDemandInfo`,
          `setIdNewStrictness`,
-         `setIdTyGenInfo`,
          `setIdWorkerInfo`,
          `setIdSpecialisation`,
          `setInlinePragma`,
@@ -350,14 +347,6 @@ zapIdNewStrictness :: Id -> Id
 zapIdNewStrictness id = modifyIdInfo (`setNewStrictnessInfo` Nothing) id
 
        ---------------------------------
-       -- TYPE GENERALISATION
-idTyGenInfo :: Id -> TyGenInfo
-idTyGenInfo id = tyGenInfo (idInfo id)
-
-setIdTyGenInfo :: Id -> TyGenInfo -> Id
-setIdTyGenInfo id tygen_info = modifyIdInfo (`setTyGenInfo` tygen_info) id
-
-       ---------------------------------
        -- WORKER ID
 idWorkerInfo :: Id -> WorkerInfo
 idWorkerInfo id = workerInfo (idInfo id)
@@ -383,11 +372,14 @@ setIdDemandInfo :: Id -> Demand.Demand -> Id
 setIdDemandInfo id demand_info = modifyIdInfo (`setDemandInfo` demand_info) id
 #endif
 
-idNewDemandInfo :: Id -> NewDemand.Demand
-idNewDemandInfo id = newDemandInfo (idInfo id)
+idNewDemandInfo_maybe :: Id -> Maybe NewDemand.Demand
+idNewDemandInfo       :: Id -> NewDemand.Demand
+
+idNewDemandInfo_maybe id = newDemandInfo (idInfo id)
+idNewDemandInfo       id = newDemandInfo (idInfo id) `orElse` NewDemand.topDmd
 
 setIdNewDemandInfo :: Id -> NewDemand.Demand -> Id
-setIdNewDemandInfo id dmd = modifyIdInfo (`setNewDemandInfo` dmd) id
+setIdNewDemandInfo id dmd = modifyIdInfo (`setNewDemandInfo` Just dmd) id
 
        ---------------------------------
        -- SPECIALISATION