ghc-10.0.0.20260917: The GHC API
Safe HaskellNone
LanguageGHC2024

GHC.Unit.External.ModuleOrigin

Synopsis

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

  • fromOrigUnit :: Maybe Bool

    Just False means that this module is in someone's exported-modules list, but that package is hidden; Just True means that it is available; Nothing means neither applies.

  • fromExposedReexport :: [UnitInfo]

    Is the module available from a reexport of an exposed package? There could be multiple.

  • fromHiddenReexport :: [UnitInfo]

    Is the module available from a reexport of a hidden package?

  • fromPackageFlag :: Bool

    Did the module export come from a package flag? (ToDo: track more information.

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.