RnUtils

ghc-8.4.4: The GHC API

Safe Haskell | None
Language | Haskell2010

RnUtils

Synopsis

- checkDupRdrNames :: [Located RdrName] -> RnM ()
- checkShadowedRdrNames :: [Located RdrName] -> RnM ()
- checkDupNames :: [Name] -> RnM ()
- checkDupAndShadowedNames :: (GlobalRdrEnv, LocalRdrEnv) -> [Name] -> RnM ()
- dupNamesErr :: Outputable n => (n -> SrcSpan) -> NonEmpty n -> RnM ()
- checkTupSize :: Int -> RnM ()
- addFvRn :: FreeVars -> RnM (thing, FreeVars) -> RnM (thing, FreeVars)
- mapFvRn :: (a -> RnM (b, FreeVars)) -> [a] -> RnM ([b], FreeVars)
- mapMaybeFvRn :: (a -> RnM (b, FreeVars)) -> Maybe a -> RnM (Maybe b, FreeVars)
- warnUnusedMatches :: [Name] -> FreeVars -> RnM ()
- warnUnusedTypePatterns :: [Name] -> FreeVars -> RnM ()
- warnUnusedTopBinds :: [GlobalRdrElt] -> RnM ()
- warnUnusedLocalBinds :: [Name] -> FreeVars -> RnM ()
- mkFieldEnv :: GlobalRdrEnv -> NameEnv (FieldLabelString, Name)
- unknownSubordinateErr :: SDoc -> RdrName -> SDoc
- badQualBndrErr :: RdrName -> SDoc
- data HsDocContext
  - = TypeSigCtx SDoc
  - | PatCtx
  - | SpecInstSigCtx
  - | DefaultDeclCtx
  - | ForeignDeclCtx (Located RdrName)
  - | DerivDeclCtx
  - | RuleCtx FastString
  - | TyDataCtx (Located RdrName)
  - | TySynCtx (Located RdrName)
  - | TyFamilyCtx (Located RdrName)
  - | FamPatCtx (Located RdrName)
  - | ConDeclCtx [Located Name]
  - | ClassDeclCtx (Located RdrName)
  - | ExprWithTySigCtx
  - | TypBrCtx
  - | HsTypeCtx
  - | GHCiCtx
  - | SpliceTypeCtx (LHsType GhcPs)
  - | ClassInstanceCtx
  - | VectDeclCtx (Located RdrName)
  - | GenericCtx SDoc
- pprHsDocContext :: HsDocContext -> SDoc
- inHsDocContext :: HsDocContext -> SDoc
- withHsDocContext :: HsDocContext -> SDoc -> SDoc
- newLocalBndrRn :: Located RdrName -> RnM Name
- newLocalBndrsRn :: [Located RdrName] -> RnM [Name]
- bindLocalNames :: [Name] -> RnM a -> RnM a
- bindLocalNamesFV :: [Name] -> RnM (a, FreeVars) -> RnM (a, FreeVars)
- addNameClashErrRn :: RdrName -> [GlobalRdrElt] -> RnM ()
- extendTyVarEnvFVRn :: [Name] -> RnM (a, FreeVars) -> RnM (a, FreeVars)

# Documentation

checkDupRdrNames :: [Located RdrName] -> RnM () #

checkShadowedRdrNames :: [Located RdrName] -> RnM () #

checkDupNames :: [Name] -> RnM () #

checkDupAndShadowedNames :: (GlobalRdrEnv, LocalRdrEnv) -> [Name] -> RnM () #

dupNamesErr :: Outputable n => (n -> SrcSpan) -> NonEmpty n -> RnM () #

checkTupSize :: Int -> RnM () #

addFvRn :: FreeVars -> RnM (thing, FreeVars) -> RnM (thing, FreeVars) #

mapFvRn :: (a -> RnM (b, FreeVars)) -> [a] -> RnM ([b], FreeVars) #

mapMaybeFvRn :: (a -> RnM (b, FreeVars)) -> Maybe a -> RnM (Maybe b, FreeVars) #

warnUnusedMatches :: [Name] -> FreeVars -> RnM () #

warnUnusedTypePatterns :: [Name] -> FreeVars -> RnM () #

warnUnusedTopBinds :: [GlobalRdrElt] -> RnM () #

warnUnusedLocalBinds :: [Name] -> FreeVars -> RnM () #

mkFieldEnv :: GlobalRdrEnv -> NameEnv (FieldLabelString, Name) #

Make a map from selector names to field labels and parent tycon names, to be used when reporting unused record fields.

unknownSubordinateErr :: SDoc -> RdrName -> SDoc #

badQualBndrErr :: RdrName -> SDoc #

data HsDocContext #

Constructors

TypeSigCtx SDoc |
PatCtx |
SpecInstSigCtx |
DefaultDeclCtx |
ForeignDeclCtx (Located RdrName) |
DerivDeclCtx |
RuleCtx FastString |
TyDataCtx (Located RdrName) |
TySynCtx (Located RdrName) |
TyFamilyCtx (Located RdrName) |
FamPatCtx (Located RdrName) |
ConDeclCtx [Located Name] |
ClassDeclCtx (Located RdrName) |
ExprWithTySigCtx |
TypBrCtx |
HsTypeCtx |
GHCiCtx |
SpliceTypeCtx (LHsType GhcPs) |
ClassInstanceCtx |
VectDeclCtx (Located RdrName) |
GenericCtx SDoc |

pprHsDocContext :: HsDocContext -> SDoc #

inHsDocContext :: HsDocContext -> SDoc #

withHsDocContext :: HsDocContext -> SDoc -> SDoc #

newLocalBndrRn :: Located RdrName -> RnM Name #

newLocalBndrsRn :: [Located RdrName] -> RnM [Name] #

bindLocalNames :: [Name] -> RnM a -> RnM a #

bindLocalNamesFV :: [Name] -> RnM (a, FreeVars) -> RnM (a, FreeVars) #

addNameClashErrRn :: RdrName -> [GlobalRdrElt] -> RnM () #

extendTyVarEnvFVRn :: [Name] -> RnM (a, FreeVars) -> RnM (a, FreeVars) #