X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Frename%2FRnNames.lhs;h=7ccc7a21d2bebceeec61e05c73ff3323643b6823;hb=6e9c0431a7cf2bf1a48f01db48c6a1d41fe15a09;hp=803744957f28a0367961a5fab78cb497be3c4e89;hpb=623e6139a5a3834bb1eb0582763c464549f7b918;p=ghc-hetmet.git diff --git a/compiler/rename/RnNames.lhs b/compiler/rename/RnNames.lhs index 8037449..7ccc7a2 100644 --- a/compiler/rename/RnNames.lhs +++ b/compiler/rename/RnNames.lhs @@ -722,7 +722,7 @@ gresFromIE decl_spec (L loc ie, avail) mkChildEnv :: [GlobalRdrElt] -> NameEnv [Name] mkChildEnv gres = foldr add emptyNameEnv gres where - add (GRE { gre_name = n, gre_par = ParentIs p }) env = extendNameEnv_C (++) env p [n] + add (GRE { gre_name = n, gre_par = ParentIs p }) env = extendNameEnv_Acc (:) singleton env p n add _ env = env findChildren :: NameEnv [Name] -> Name -> [Name] @@ -1304,20 +1304,20 @@ isImpAll _other = False \begin{code} warnUnusedImport :: ImportDeclUsage -> RnM () -warnUnusedImport (L loc decl, used, unused) - | Just (False,[]) <- ideclHiding decl - = return () -- Do not warn for 'import M()' +warnUnusedImport (L loc decl, used, unused) + | Just (False,[]) <- ideclHiding decl + = return () -- Do not warn for 'import M()' | null used = addWarnAt loc msg1 -- Nothing used; drop entire decl - | null unused = return () -- Everything imported is used; nop + | null unused = return () -- Everything imported is used; nop | otherwise = addWarnAt loc msg2 -- Some imports are unused where msg1 = vcat [pp_herald <+> quotes pp_mod <+> pp_not_used, - nest 2 (ptext (sLit "except perhaps to import instances from") - <+> quotes pp_mod), - ptext (sLit "To import instances alone, use:") - <+> ptext (sLit "import") <+> pp_mod <> parens empty ] + nest 2 (ptext (sLit "except perhaps to import instances from") + <+> quotes pp_mod), + ptext (sLit "To import instances alone, use:") + <+> ptext (sLit "import") <+> pp_mod <> parens empty ] msg2 = sep [pp_herald <+> quotes (pprWithCommas ppr unused), - text "from module" <+> quotes pp_mod <+> pp_not_used] + text "from module" <+> quotes pp_mod <+> pp_not_used] pp_herald = text "The import of" pp_mod = ppr (unLoc (ideclName decl)) pp_not_used = text "is redundant"