HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Package index data type

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

Updates

Queries

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