HORIZON HASKELLDocslts/ghc-10.0.xaa25b892026-10-10Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10

Moduleghc-10.0.0.20260917GHC2024

GHC.Unit.External.ModuleOrigin

  • 1 type
  • 5 values
datadata ModuleOrigin
#

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.

    • 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.

Instances3Semigroup, Monoid, Outputable

Smart constructor for a module which is in exposed-modules. Takes as an argument whether or not the defining package is exposed.

Is the name from the import actually visible? (i.e. does it cause ambiguity, or is it only relevant when we're making suggestions?)

Are there actually no providers for this module? This will never occur except when we're filtering based on package imports.