stack- The Haskell Tool Stack

Safe HaskellNone



Dealing with the 01-index file and all its cabal files.



updateAllIndices :: HasCabalLoader env => RIO env () Source #

Update all of the package indices

getPackageCaches :: HasCabalLoader env => RIO env (PackageCache PackageIndex) Source #

Load the package caches, or create the caches if necessary.

This has two levels of caching: in memory, and the on-disk cache. So, feel free to call this function multiple times.

getPackageVersions :: HasCabalLoader env => PackageName -> RIO env (HashMap Version (Maybe CabalHash)) Source #

Get the known versions for a given package from the package caches.

See getPackageCaches for performance notes.

data CabalLoader Source #




  • clCache :: !(IORef (Maybe (PackageCache PackageIndex)))
  • clIndices :: ![PackageIndex]

    Information on package indices. This is left biased, meaning that packages in an earlier index will shadow those in a later index.

    Warning: if you override packages in an index vs what's available upstream, you may correct your compiled snapshots, as different projects may have different definitions of what pkg-ver means! This feature is primarily intended for adding local packages, not overriding. Overriding is better accomplished by adding to your list of packages.

    Note that indices specified in a later config file will override previous indices, not extend them.

    Using an assoc list instead of a Map to keep track of priority

  • clStackRoot :: !(Path Abs Dir)

    ~/.stack more often than not

  • clUpdateRef :: !(MVar Bool)

    Want to try updating the index once during a single run for missing package identifiers. We also want to ensure we only update once at a time. Start at True.

    TODO: probably makes sense to move this concern into getPackageCaches

  • clConnectionCount :: !Int

    How many concurrent connections are allowed when downloading

  • clIgnoreRevisionMismatch :: !Bool

    Ignore a revision mismatch when loading up cabal files, and fall back to the latest revision. See:

configPackageIndex :: HasCabalLoader env => IndexName -> RIO env (Path Abs File) Source #

Location of the 01-index.tar file

configPackageIndexRoot :: HasCabalLoader env => IndexName -> RIO env (Path Abs Dir) Source #

Root for a specific package index