import TcRnMonad
import RnEnv
import HscTypes ( availNames )
-import RnNames ( getLocalDeclBinders, extendRdrEnvRn )
import RnTypes ( rnHsTypeFVs,
mkOpFormRn, mkOpAppRn, mkNegAppRn, checkSectionPrec, mkConOpPatRn
)
import Name ( Name, nameOccName, nameModule_maybe, getOccName, nameSrcSpan )
import OccName ( occEnvElts )
import NameSet
-import UniqFM
+import LazyUniqFM
import RdrName ( RdrName, GlobalRdrElt(..), Provenance(..),
extendLocalRdrEnv, lookupLocalRdrEnv, hideSomeUnquals,
mkRdrUnqual, nameRdrName, gre_name, globalRdrEnvElts, isLocalGRE )
matchNameMaker
= NM (\ rdr_name thing_inside ->
do { names@[name] <- newLocalsRn [rdr_name]
- ; bindLocalNamesFV names $
- warnUnusedMatches names $
- thing_inside name })
+ ; bindLocalNamesFV names $ do
+ { (res, fvs) <- thing_inside name
+ ; warnUnusedMatches names fvs
+ ; return (res, fvs) }})
topRecNameMaker, localRecNameMaker
- :: UniqFM (Located Fixity) -- mini fixity env for the names we're about to bind
- -- these fixities need to be brought into scope with the names
- -> NameMaker
+ :: MiniFixityEnv -> NameMaker
-- topNameMaker and localBindMaker do not check for unused binding
localRecNameMaker fix_env
[(nameSrcSpan name, nameOccName name) | name <- names]
; thing_inside pats' } }
where
- doc_pat = ptext SLIT("In") <+> pprMatchContext ctxt
+ doc_pat = ptext (sLit "In") <+> pprMatchContext ctxt
-- entry point 2:
\ fields2 ->
cont (HsRecFields (fields1 ++ fields2) dd)
-needFlagDotDot str = vcat [ptext SLIT("Illegal `..' in record") <+> text str,
- ptext SLIT("Use -XRecordWildCards to permit this")]
+needFlagDotDot str = vcat [ptext (sLit "Illegal `..' in record") <+> text str,
+ ptext (sLit "Use -XRecordWildCards to permit this")]
-badDotDot str = ptext SLIT("You cannot use `..' in record") <+> text str
+badDotDot str = ptext (sLit "You cannot use `..' in record") <+> text str
-badPun fld = vcat [ptext SLIT("Illegal use of punning for field") <+> quotes (ppr fld),
- ptext SLIT("Use -XRecordPuns to permit this")]
+badPun fld = vcat [ptext (sLit "Illegal use of punning for field") <+> quotes (ppr fld),
+ ptext (sLit "Use -XRecordPuns to permit this")]
-- wrappers
| tup_size <= mAX_TUPLE_SIZE
= return ()
| otherwise
- = addErr (sep [ptext SLIT("A") <+> int tup_size <> ptext SLIT("-tuple is too large for GHC"),
- nest 2 (parens (ptext SLIT("max size is") <+> int mAX_TUPLE_SIZE)),
- nest 2 (ptext SLIT("Workaround: use nested tuples or define a data type"))])
+ = addErr (sep [ptext (sLit "A") <+> int tup_size <> ptext (sLit "-tuple is too large for GHC"),
+ nest 2 (parens (ptext (sLit "max size is") <+> int mAX_TUPLE_SIZE)),
+ nest 2 (ptext (sLit "Workaround: use nested tuples or define a data type"))])
patSigErr ty
- = (ptext SLIT("Illegal signature in pattern:") <+> ppr ty)
- $$ nest 4 (ptext SLIT("Use -XPatternSignatures to permit it"))
+ = (ptext (sLit "Illegal signature in pattern:") <+> ppr ty)
+ $$ nest 4 (ptext (sLit "Use -XPatternSignatures to permit it"))
dupFieldErr str dup
- = hsep [ptext SLIT("duplicate field name"),
+ = hsep [ptext (sLit "duplicate field name"),
quotes (ppr dup),
- ptext SLIT("in record"), text str]
+ ptext (sLit "in record"), text str]
bogusCharError c
- = ptext SLIT("character literal out of range: '\\") <> char c <> char '\''
+ = ptext (sLit "character literal out of range: '\\") <> char c <> char '\''
-badViewPat pat = vcat [ptext SLIT("Illegal view pattern: ") <+> ppr pat,
- ptext SLIT("Use -XViewPatterns to enalbe view patterns")]
+badViewPat pat = vcat [ptext (sLit "Illegal view pattern: ") <+> ppr pat,
+ ptext (sLit "Use -XViewPatterns to enable view patterns")]
\end{code}