X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Frename%2FRnEnv.lhs;h=a0d323ded322ff039c8861d9b5906aaa96e0c501;hb=af075cd3341968e4eac6f95cd76df17e99597fa8;hp=63db61ccb646e766e7529786b62f29d50d03b17d;hpb=d1984e439154e95b2804ee83897e740b1713c53d;p=ghc-hetmet.git diff --git a/compiler/rename/RnEnv.lhs b/compiler/rename/RnEnv.lhs index 63db61c..a0d323d 100644 --- a/compiler/rename/RnEnv.lhs +++ b/compiler/rename/RnEnv.lhs @@ -30,7 +30,7 @@ module RnEnv ( mapFvRn, mapFvRnCPS, warnUnusedMatches, warnUnusedModules, warnUnusedImports, warnUnusedTopBinds, warnUnusedLocalBinds, - dataTcOccs, unknownNameErr + dataTcOccs, unknownNameErr, perhapsForallMsg ) where #include "HsVersions.h" @@ -470,7 +470,7 @@ lookupQualifiedName rdr_name | Just (mod,occ) <- isQual_maybe rdr_name -- Note: we want to behave as we would for a source file import here, -- and respect hiddenness of modules/packages, hence loadSrcInterface. - = loadSrcInterface doc mod False `thenM` \ iface -> + = loadSrcInterface doc mod False Nothing `thenM` \ iface -> case [ (mod,occ) | (mod,avails) <- mi_exports iface, @@ -868,11 +868,9 @@ checkShadowedNames doc_str (global_env,local_env) loc_rdr_names \begin{code} -- A useful utility mapFvRn :: (a -> RnM (b, FreeVars)) -> [a] -> RnM ([b], FreeVars) -mapFvRn f xs = mappM f xs `thenM` \ stuff -> - let - (ys, fvs_s) = unzip stuff - in - returnM (ys, plusFVs fvs_s) +mapFvRn f xs = do stuff <- mappM f xs + case unzip stuff of + (ys, fvs_s) -> returnM (ys, plusFVs fvs_s) -- because some of the rename functions are CPSed: -- maps the function across the list from left to right; @@ -986,9 +984,13 @@ unknownNameErr rdr_name <+> quotes (ppr rdr_name)) , extra ] where - extra | rdr_name == forall_tv_RDR - = ptext (sLit "Perhaps you intended to use -XRankNTypes or similar flag") - | otherwise = empty + extra | rdr_name == forall_tv_RDR = perhapsForallMsg + | otherwise = empty + +perhapsForallMsg :: SDoc +perhapsForallMsg + = vcat [ ptext (sLit "Perhaps you intended to use -XRankNTypes or similar flag") + , ptext (sLit "to enable explicit-forall syntax: forall . ")] unknownSubordinateErr :: SDoc -> RdrName -> SDoc unknownSubordinateErr doc op -- Doc is "method of class" or