mapFvRn, mapFvRnCPS,
warnUnusedMatches, warnUnusedModules, warnUnusedImports,
warnUnusedTopBinds, warnUnusedLocalBinds,
- dataTcOccs, unknownNameErr
+ dataTcOccs, unknownNameErr, perhapsForallMsg
) where
#include "HsVersions.h"
\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;
<+> quotes (ppr rdr_name))
, extra ]
where
- extra | rdr_name == forall_tv_RDR
- = vcat [ptext (sLit "Perhaps you intended to use -XRankNTypes or similar flag"),
- ptext (sLit "to enable explicit-forall syntax: forall <tvs>. <type>?")]
- | 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 <tvs>. <type>")]
unknownSubordinateErr :: SDoc -> RdrName -> SDoc
unknownSubordinateErr doc op -- Doc is "method of class" or