module HscTypes (
GhciMode(..),
- ModuleLocation(..),
+ ModuleLocation(..), showModMsg,
ModDetails(..), ModIface(..),
HomeSymbolTable, emptySymbolTable,
import NameEnv
import OccName ( OccName )
import Module ( Module, ModuleName, ModuleEnv,
- lookupModuleEnv, lookupModuleEnvByName, emptyModuleEnv
+ lookupModuleEnv, lookupModuleEnvByName,
+ emptyModuleEnv, moduleUserString
)
import InstEnv ( InstEnv, ClsInstEnv, DFunId )
import Rules ( RuleBase )
import Maybes ( seqMaybe, orElse )
import Outputable
import SrcLoc ( SrcLoc, isGoodSrcLoc )
-import Util ( thenCmp, sortLt )
+import Util ( thenCmp, sortLt, unJust )
import UniqSupply ( UniqSupply )
\end{code}
instance Outputable ModuleLocation where
ppr = text . show
+
+-- Probably doesn't really belong here, but used in HscMain and InteractiveUI.
+
+showModMsg :: Bool -> Module -> ModuleLocation -> String
+showModMsg use_object mod location =
+ mod_str ++ replicate (max 0 (16 - length mod_str)) ' '
+ ++" ( " ++ unJust "showModMsg" (ml_hs_file location) ++ ", "
+ ++ (if use_object
+ then unJust "showModMsg" (ml_obj_file location)
+ else "interpreted")
+ ++ " )"
+ where mod_str = moduleUserString mod
\end{code}
For a module in another package, the hs_file and obj_file