RnNames

ghc-8.8.0.20190424: The GHC API

Safe Haskell | None
Language | Haskell2010

RnNames

Synopsis

- rnImports :: [LImportDecl GhcPs] -> RnM ([LImportDecl GhcRn], GlobalRdrEnv, ImportAvails, AnyHpcUsage)
- getLocalNonValBinders :: MiniFixityEnv -> HsGroup GhcPs -> RnM ((TcGblEnv, TcLclEnv), NameSet)
- newRecordSelector :: Bool -> [Name] -> LFieldOcc GhcPs -> RnM FieldLabel
- extendGlobalRdrEnvRn :: [AvailInfo] -> MiniFixityEnv -> RnM (TcGblEnv, TcLclEnv)
- gresFromAvails :: Maybe ImportSpec -> [AvailInfo] -> [GlobalRdrElt]
- calculateAvails :: DynFlags -> ModIface -> IsSafeImport -> IsBootInterface -> ImportedBy -> ImportAvails
- reportUnusedNames :: Maybe (Located [LIE GhcPs]) -> TcGblEnv -> RnM ()
- checkConName :: RdrName -> TcRn ()
- mkChildEnv :: [GlobalRdrElt] -> NameEnv [GlobalRdrElt]
- findChildren :: NameEnv [a] -> Name -> [a]
- dodgyMsg :: (Outputable a, Outputable b) => SDoc -> a -> b -> SDoc
- dodgyMsgInsert :: forall p. IdP (GhcPass p) -> IE (GhcPass p)
- findImportUsage :: [LImportDecl GhcRn] -> [GlobalRdrElt] -> [ImportDeclUsage]
- getMinimalImports :: [ImportDeclUsage] -> RnM [LImportDecl GhcRn]
- printMinimalImports :: [ImportDeclUsage] -> RnM ()
- type ImportDeclUsage = (LImportDecl GhcRn, [GlobalRdrElt], [Name])

# Documentation

rnImports :: [LImportDecl GhcPs] -> RnM ([LImportDecl GhcRn], GlobalRdrEnv, ImportAvails, AnyHpcUsage) Source #

Process Import Decls. See `rnImportDecl` for a description of what the return types represent. Note: Do the non SOURCE ones first, so that we get a helpful warning for SOURCE ones that are unnecessary

getLocalNonValBinders :: MiniFixityEnv -> HsGroup GhcPs -> RnM ((TcGblEnv, TcLclEnv), NameSet) Source #

newRecordSelector :: Bool -> [Name] -> LFieldOcc GhcPs -> RnM FieldLabel Source #

extendGlobalRdrEnvRn :: [AvailInfo] -> MiniFixityEnv -> RnM (TcGblEnv, TcLclEnv) Source #

gresFromAvails :: Maybe ImportSpec -> [AvailInfo] -> [GlobalRdrElt] Source #

make a `GlobalRdrEnv` where all the elements point to the same Provenance (useful for "hiding" imports, or imports with no details).

calculateAvails :: DynFlags -> ModIface -> IsSafeImport -> IsBootInterface -> ImportedBy -> ImportAvails Source #

Calculate the `ImportAvails` induced by an import of a particular interface, but without `imp_mods`.

reportUnusedNames :: Maybe (Located [LIE GhcPs]) -> TcGblEnv -> RnM () Source #

checkConName :: RdrName -> TcRn () Source #

mkChildEnv :: [GlobalRdrElt] -> NameEnv [GlobalRdrElt] Source #

findChildren :: NameEnv [a] -> Name -> [a] Source #

dodgyMsg :: (Outputable a, Outputable b) => SDoc -> a -> b -> SDoc Source #

dodgyMsgInsert :: forall p. IdP (GhcPass p) -> IE (GhcPass p) Source #

findImportUsage :: [LImportDecl GhcRn] -> [GlobalRdrElt] -> [ImportDeclUsage] Source #

getMinimalImports :: [ImportDeclUsage] -> RnM [LImportDecl GhcRn] Source #

printMinimalImports :: [ImportDeclUsage] -> RnM () Source #

type ImportDeclUsage = (LImportDecl GhcRn, [GlobalRdrElt], [Name]) Source #