HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulehackage-db-2.1.3Haskell2010

Distribution.Hackage.DB.Path

Find the location of the local Hackage database that is maintained by running cabal update.

  • 4 values
  • Packagehackage-db-2.1.3
  • Exports4
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourcePath.hs

Determines the state directory (which e.g. holds the hackage tarball) cabal-install uses via the following logic:

  1. If the CABAL_DIR environment variable is set, its content is used as the cabal state directory

  2. If ~/.cabal (see getAppUserDataDirectory) exists, use that.

  3. Otherwise, use ${XDG_CACHE_HOME}/cabal (see getXdgDirectory XdgCache) which is the new directory cabal-install can use starting with version 3.10.*.

This logic is mostly equivalent to what upstream cabal-install is doing with the following exception: The state directory can freely be configured to use a different location in the cabal-install configuration file. hackage-db doesn't parse this configuration file, so differing state directories are ignored.

Determine the default path of the Hackage database, which typically resides in $HOME/.cabal/packages/hackage.haskell.org/. Running the command cabal update or cabal v2-update will keep the index up-to-date.

See cabalStateDir on how hackage-db searches for the cabal state directory.