diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2014-01-09 16:19:22 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2014-01-09 17:58:47 +0000 |
commit | 19e23dce902fbbafca4add832b6b500c4fb31d37 (patch) | |
tree | caf91815a35bd80b5f922482047b0409bd389bcc /ghc | |
parent | 0ec530202369fef2fecc7446027a65b4a345f0a9 (diff) | |
download | haskell-19e23dce902fbbafca4add832b6b500c4fb31d37.tar.gz |
A little refactoring so that we print package-qualified modules names if necessary
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/InteractiveUI.hs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index 537581215c..1476f95add 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -1374,8 +1374,7 @@ afterLoad ok retain_context = do lift discardTickArrays loaded_mod_summaries <- getLoadedModules let loaded_mods = map GHC.ms_mod loaded_mod_summaries - loaded_mod_names = map GHC.moduleName loaded_mods - modulesLoadedMsg ok loaded_mod_names + modulesLoadedMsg ok loaded_mods lift $ setContextAfterLoad retain_context loaded_mod_summaries @@ -1448,20 +1447,22 @@ keepPackageImports = filterM is_pkg_import mod_name = unLoc (ideclName d) -modulesLoadedMsg :: SuccessFlag -> [ModuleName] -> InputT GHCi () +modulesLoadedMsg :: SuccessFlag -> [Module] -> InputT GHCi () modulesLoadedMsg ok mods = do dflags <- getDynFlags - when (verbosity dflags > 0) $ do - let mod_commas + unqual <- GHC.getPrintUnqual + let mod_commas | null mods = text "none." | otherwise = hsep ( punctuate comma (map ppr mods)) <> text "." - case ok of - Failed -> - liftIO $ putStrLn $ showSDoc dflags (text "Failed, modules loaded: " <> mod_commas) - Succeeded -> - liftIO $ putStrLn $ showSDoc dflags (text "Ok, modules loaded: " <> mod_commas) + status = case ok of + Failed -> text "Failed" + Succeeded -> text "Ok" + + msg = status <> text ", modules loaded:" <+> mod_commas + when (verbosity dflags > 0) $ + liftIO $ putStrLn $ showSDocForUser dflags unqual msg ----------------------------------------------------------------------------- -- :type |