VersionInfo(..), initialVersionInfo,
- TyThing(..), groupTyThings,
+ TyThing(..), groupTyThings, isTyClThing,
TypeEnv, extendTypeEnv, lookupTypeEnv,
)
import Rules ( RuleBase )
import VarSet ( TyVarSet )
-import VarEnv ( emptyVarEnv )
import Id ( Id )
import Class ( Class )
import TyCon ( TyCon )
import RdrHsSyn ( RdrNameHsDecl, RdrNameTyClDecl )
import RnHsSyn ( RenamedTyClDecl, RenamedRuleDecl, RenamedInstDecl )
-import CoreSyn ( CoreRule )
+import CoreSyn ( CoreRule, IdCoreRule )
import Type ( Type )
import FiniteMap ( FiniteMap, emptyFM, addToFM, lookupFM, foldFM )
-- (changing usages doesn't affect the version of
-- this module)
- mi_exports :: Avails, -- What it exports
+ mi_exports :: [(ModuleName,Avails)], -- What it exports
-- Kept sorted by (mod,occ),
-- to make version comparisons easier
-- The next three fields are created by the typechecker
md_types :: TypeEnv,
md_insts :: [DFunId], -- Dfun-ids for the instances in this module
- md_rules :: [(Id,CoreRule)] -- Domain may include Ids from other modules
+ md_rules :: [IdCoreRule] -- Domain may include Ids from other modules
}
\end{code}
| ATyCon TyCon
| AClass Class
+isTyClThing :: TyThing -> Bool
+isTyClThing (ATyCon _) = True
+isTyClThing (AClass _) = True
+isTyClThing (AnId _) = False
+
instance NamedThing TyThing where
getName (AnId id) = getName id
getName (ATyCon tc) = getName tc
vers_decls = emptyNameEnv }
data Deprecations = NoDeprecs
- | DeprecAll DeprecTxt -- Whole module deprecated
- | DeprecSome (NameEnv DeprecTxt) -- Some things deprecated
- -- Just "big" names
+ | DeprecAll DeprecTxt -- Whole module deprecated
+ | DeprecSome (NameEnv (Name,DeprecTxt)) -- Some things deprecated
+ -- Just "big" names
+ -- We keep the Name in the range, so we can print them out
lookupDeprec :: ModIface -> Name -> Maybe DeprecTxt
lookupDeprec iface name
= case mi_deprecs iface of
NoDeprecs -> Nothing
DeprecAll txt -> Just txt
- DeprecSome env -> lookupNameEnv env name
+ DeprecSome env -> case lookupNameEnv env name of
+ Just (_, txt) -> Just txt
+ Nothing -> Nothing
type InstEnv = UniqFM ClsInstEnv -- Maps Class to instances for that class