Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- rnImports :: [(LImportDecl GhcPs, SDoc)] -> RnM ([LImportDecl GhcRn], [ImportUserSpec], GlobalRdrEnv, ImportAvails, [(Module, IfaceDefault)], AnyHpcUsage)
- getLocalNonValBinders :: MiniFixityEnv -> HsGroup GhcPs -> RnM ((TcGblEnv, TcLclEnv), NameSet)
- newRecordFieldLabel :: DuplicateRecordFields -> FieldSelectors -> [Name] -> LFieldOcc GhcPs -> RnM FieldLabel
- importsFromIface :: HscEnv -> ModIface -> ImpDeclSpec -> Maybe NameSet -> GlobalRdrEnv
- data ImportUserSpec = ImpUserSpec {}
- extendGlobalRdrEnvRn :: [GlobalRdrElt] -> MiniFixityEnv -> RnM (TcGblEnv, TcLclEnv)
- gresFromAvails :: HscEnv -> Maybe ImportSpec -> [AvailInfo] -> [GlobalRdrElt]
- calculateAvails :: HomeUnit -> Set UnitId -> ModIface -> IsSafeImport -> IsBootInterface -> ImportedBy -> ImportAvails
- reportUnusedNames :: TcGblEnv -> HscSource -> RnM ()
- checkConName :: RdrName -> TcRn ()
- mkChildEnv :: [GlobalRdrElt] -> NameEnv [GlobalRdrElt]
- findChildren :: NameEnv [a] -> Name -> [a]
- findImportUsage :: [LImportDecl GhcRn] -> [GlobalRdrElt] -> [ImportDeclUsage]
- getMinimalImports :: [ImportDeclUsage] -> RnM [LImportDecl GhcRn]
- printMinimalImports :: HscSource -> [ImportDeclUsage] -> RnM ()
- renamePkgQual :: UnitEnv -> ModuleName -> Maybe FastString -> PkgQual
- renameRawPkgQual :: UnitEnv -> ModuleName -> RawPkgQual -> PkgQual
- classifyGREs :: [GlobalRdrElt] -> ([GlobalRdrElt], [FieldGlobalRdrElt])
- type ImportDeclUsage = (LImportDecl GhcRn, [GlobalRdrElt], [Name])
Documentation
rnImports :: [(LImportDecl GhcPs, SDoc)] -> RnM ([LImportDecl GhcRn], [ImportUserSpec], GlobalRdrEnv, ImportAvails, [(Module, IfaceDefault)], 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 #
newRecordFieldLabel :: DuplicateRecordFields -> FieldSelectors -> [Name] -> LFieldOcc GhcPs -> RnM FieldLabel Source #
importsFromIface :: HscEnv -> ModIface -> ImpDeclSpec -> Maybe NameSet -> GlobalRdrEnv Source #
data ImportUserSpec Source #
The import specification as written by the user, including
the list of explicitly imported names. Used in ModIface
to
allow GHCi to reconstruct the top level environment on demand.
This is distinct from ImportSpec
because we don't want to store
the list of explicitly imported names along with each GRE
We don't want to store the entire GlobalRdrEnv for modules that are imported without explicit export lists, as these may grow to be very large. However, GlobalRdrEnvs which are the result of explicit import lists are typically quite small.
Why do we not store something like (Maybe (ImportListInterpretation, [IE GhcPs]) in such a case? Because we don't want to store source syntax including annotations in interface files.
extendGlobalRdrEnvRn :: [GlobalRdrElt] -> MiniFixityEnv -> RnM (TcGblEnv, TcLclEnv) Source #
gresFromAvails :: HscEnv -> Maybe ImportSpec -> [AvailInfo] -> [GlobalRdrElt] Source #
All the GlobalRdrElt
s associated with a collection of AvailInfo
s.
calculateAvails :: HomeUnit -> Set UnitId -> ModIface -> IsSafeImport -> IsBootInterface -> ImportedBy -> ImportAvails Source #
Calculate the ImportAvails
induced by an import of a particular
interface, but without imp_mods
.
checkConName :: RdrName -> TcRn () Source #
mkChildEnv :: [GlobalRdrElt] -> NameEnv [GlobalRdrElt] Source #
findChildren :: NameEnv [a] -> Name -> [a] Source #
findImportUsage :: [LImportDecl GhcRn] -> [GlobalRdrElt] -> [ImportDeclUsage] Source #
getMinimalImports :: [ImportDeclUsage] -> RnM [LImportDecl GhcRn] Source #
printMinimalImports :: HscSource -> [ImportDeclUsage] -> RnM () Source #
renamePkgQual :: UnitEnv -> ModuleName -> Maybe FastString -> PkgQual Source #
Rename raw package imports
renameRawPkgQual :: UnitEnv -> ModuleName -> RawPkgQual -> PkgQual Source #
Rename raw package imports
classifyGREs :: [GlobalRdrElt] -> ([GlobalRdrElt], [FieldGlobalRdrElt]) Source #
type ImportDeclUsage = (LImportDecl GhcRn, [GlobalRdrElt], [Name]) Source #