HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulecabal-install-solver-3.12.1.0Haskell2010

Distribution.Solver.Types.PackageIndex

An index of packages.

  • 2 types
  • 17 values

Package index data type

1 declaration
newtypenewtype PackageIndex pkg
#

The collection of information about packages from one or more PackageDBs.

It can be searched efficiently by package name and version.

Instances9Functor, Eq, Read, Show, Generic, Semigroup, …

Creating an index

1 declaration
valuefromList :: Package pkg => [pkg] -> PackageIndex pkg
#

Build an index out of a bunch of packages.

If there are duplicates, later ones mask earlier ones.

Updates

6 declarations

Queries

0 declarations

Precise lookups

Case-insensitive searches

valuesearchByName :: PackageIndex pkg -> String -> [(PackageName, [pkg])]
#

Does a case-insensitive search by package name.

If there is only one package that compares case-insensitively to this name then the search is unambiguous and we get back all versions of that package. If several match case-insensitively but one matches exactly then it is also unambiguous.

If however several match case-insensitively and none match exactly then we have an ambiguous result, and we get back all the versions of all the packages. The list of ambiguous results is split by exact package name. So it is a non-empty list of non-empty lists.

Bulk queries