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

  • 4 types
  • 10 values

ExternalUnitDatabases

5 declarations

UnitDatabase and how to merge them.

5 declarations

For each unit, a mapping from uid -> i indicates that this unit was brought into GHC by the ith -package-db flag on the command line. We use this mapping to make sure we prefer units that were defined later on the command line, if there is an ambiguity.

Returns GT if pkg should be preferred over pkg' when picking which should be "active". Here is the order of preference:

  1. First, prefer the latest version

  2. If the versions are the same, prefer the package that came in the latest package database.

Pursuant to #12518, we could change this policy to, for example, remove the version preference, meaning that we would always prefer the units in later unit database.

Reading packages from disk.

4 declarations

Return the path of a package database from a PkgDbRef. Return Nothing when the user database filepath is expected but the latter doesn't exist.

NB: This logic is reimplemented in Cabal, so if you change it, make sure you update Cabal. (Or, better yet, dump it in the compiler info so Cabal can use the info.)