Commit f9f5235f authored by simonpj's avatar simonpj
Browse files

[project @ 2005-10-27 15:21:05 by simonpj]

Improve warning a little (suggested by Benjamin Pierce)
parent c27d86e0
......@@ -709,10 +709,13 @@ warnUnusedModules mods
= ifOptM Opt_WarnUnusedImports (mappM_ bleat mods)
where
bleat (mod,loc) = setSrcSpan loc $ addWarn (mk_warn mod)
mk_warn m = vcat [ptext SLIT("Module") <+> quotes (ppr m) <+>
text "is imported, but nothing from it is used",
parens (ptext SLIT("except perhaps instances visible in") <+>
quotes (ppr m))]
mk_warn m = vcat [ptext SLIT("Module") <+> quotes (ppr m)
<+> text "is imported, but nothing from it is used,",
nest 2 (ptext SLIT("except perhaps instances visible in")
<+> quotes (ppr m)),
ptext SLIT("To suppress this warning, use:")
<+> ptext SLIT("import") <+> ppr m <> parens empty ]
warnUnusedImports, warnUnusedTopBinds :: [GlobalRdrElt] -> RnM ()
warnUnusedImports gres = ifOptM Opt_WarnUnusedImports (warnUnusedGREs gres)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment