| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
GHC.Unit.External.ModuleOrigin
Synopsis
- data ModuleOrigin
- = ModHidden
- | ModUnusable !UnusableUnit
- | ModOrigin { }
- fromExposedModules :: Bool -> ModuleOrigin
- fromReexportedModules :: Bool -> UnitInfo -> ModuleOrigin
- fromFlag :: ModuleOrigin
- originVisible :: ModuleOrigin -> Bool
- originEmpty :: ModuleOrigin -> Bool
Documentation
data ModuleOrigin Source #
Given a module name, there may be multiple ways it came into scope, possibly simultaneously. This data type tracks all the possible ways it could have come into scope. Warning: don't use the record functions, they're partial!
Constructors
| ModHidden | Module is hidden, and thus never will be available for import. (But maybe the user didn't realize), so we'll still keep track of these modules.) |
| ModUnusable !UnusableUnit | Module is unavailable because the unit is unusable. |
| ModOrigin | Module is public, and could have come from some places. |
Fields
| |
Instances
| Outputable ModuleOrigin Source # | |
Defined in GHC.Unit.External.ModuleOrigin Methods ppr :: ModuleOrigin -> SDoc Source # | |
| Monoid ModuleOrigin Source # | |
Defined in GHC.Unit.External.ModuleOrigin Methods mempty :: ModuleOrigin Source # mappend :: ModuleOrigin -> ModuleOrigin -> ModuleOrigin Source # mconcat :: [ModuleOrigin] -> ModuleOrigin Source # | |
| Semigroup ModuleOrigin Source # | |
Defined in GHC.Unit.External.ModuleOrigin Methods (<>) :: ModuleOrigin -> ModuleOrigin -> ModuleOrigin Source # sconcat :: NonEmpty ModuleOrigin -> ModuleOrigin Source # stimes :: Integral b => b -> ModuleOrigin -> ModuleOrigin Source # | |
fromExposedModules :: Bool -> ModuleOrigin Source #
Smart constructor for a module which is in exposed-modules. Takes
as an argument whether or not the defining package is exposed.
fromReexportedModules :: Bool -> UnitInfo -> ModuleOrigin Source #
Smart constructor for a module which is in reexported-modules. Takes
as an argument whether or not the reexporting package is exposed, and
also its UnitInfo.
fromFlag :: ModuleOrigin Source #
Smart constructor for a module which was bound by a package flag.
originVisible :: ModuleOrigin -> Bool Source #
Is the name from the import actually visible? (i.e. does it cause ambiguity, or is it only relevant when we're making suggestions?)
originEmpty :: ModuleOrigin -> Bool Source #
Are there actually no providers for this module? This will never occur except when we're filtering based on package imports.