\begin{code}
module CmTypes (
Unlinked(..), isObject, nameOfObject, isInterpretable,
- Linkable(..), linkableTime,
+ Linkable(..), isObjectLinkable,
ModSummary(..), ms_allimps, name_of_summary, pprSummaryTime
) where
isInterpretable (BCOs _ _) = True
isInterpretable _ = False
-data Linkable
- = LM ClockTime ModuleName [Unlinked]
- | LP PackageName
+data Linkable = LM {
+ linkableTime :: ClockTime,
+ linkableModName :: ModuleName,
+ linkableUnlinked :: [Unlinked]
+ }
+
+isObjectLinkable :: Linkable -> Bool
+isObjectLinkable l = all isObject (linkableUnlinked l)
instance Outputable Linkable where
ppr (LM when_made mod_nm unlinkeds)
= text "LinkableM" <+> parens (text (show when_made)) <+> ppr mod_nm
<+> ppr unlinkeds
- ppr (LP package_nm)
- = text "LinkableP" <+> ptext package_nm
-
-linkableTime (LM when_made mod_nm unlinkeds) = when_made
-linkableTime (LP package_nm) = panic "linkableTime"
-
-- The ModuleLocation contains both the original source filename and the
-- filename of the cleaned-up source file after all preprocessing has been
ms_location :: ModuleLocation, -- location
ms_srcimps :: [ModuleName], -- source imports
ms_imps :: [ModuleName], -- non-source imports
- ms_hs_date :: Maybe ClockTime -- timestamp of summarised
- -- file, if home && source
+ ms_hs_date :: ClockTime -- timestamp of summarised file
}
+-- ToDo: shouldn't ms_srcimps and ms_imps be [Module]? --SDM
+
instance Outputable ModSummary where
ppr ms
= sep [text "ModSummary {",