[project @ 2000-10-23 16:43:42 by simonpj]
[ghc-hetmet.git] / ghc / compiler / main / HscTypes.lhs
index 84b129b..a5d5816 100644 (file)
@@ -21,11 +21,13 @@ module HscTypes (
 
        WhetherHasOrphans, ImportVersion, WhatsImported(..),
        PersistentRenamerState(..), IsBootInterface, Avails, DeclsMap,
-       IfaceInsts, IfaceRules, Deprecations(..), GatedDecl,
+       IfaceInsts, IfaceRules, GatedDecl,
        OrigNameEnv(..), OrigNameNameEnv, OrigNameIParamEnv,
        AvailEnv, AvailInfo, GenAvailInfo(..),
        PersistentCompilerState(..),
 
+       Deprecations(..), lookupDeprec,
+
        InstEnv, ClsInstEnv, DFunId,
 
        GlobalRdrEnv, RdrAvailInfo,
@@ -266,6 +268,13 @@ data Deprecations = NoDeprecs
                  | DeprecSome (NameEnv DeprecTxt)      -- Some things deprecated
                                                        -- Just "big" names
 
+lookupDeprec :: ModIface -> Name -> Maybe DeprecTxt
+lookupDeprec iface name
+  = case mi_deprecs iface of
+       NoDeprecs      -> Nothing
+       DeprecAll txt  -> Just txt
+       DeprecSome env -> lookupNameEnv env name
+
 type InstEnv    = UniqFM ClsInstEnv            -- Maps Class to instances for that class
 type ClsInstEnv = [(TyVarSet, [Type], DFunId)] -- The instances for a particular class
 type DFunId    = Id