Only inspect the needed parts of the installed and available indexes The available package index is loaded lazily so if we can avoid forcing all the packages then we can save a huge amount of slow text parsing. So select out the maximal subset of the index that we could ever need based on the names of the packages we want to install. For the common case of installing just one or two packages this cuts down the number of packages we look at by a couple orders of magnitude. This does not help with the installed index which is read strictly, though most people do not (yet) have hundreds of installed packages, so that's less of an immediate problem.
Only inspect the needed parts of the installed and available indexes
The available package index is loaded lazily so if we can avoid
forcing all the packages then we can save a huge amount of slow text
parsing. So select out the maximal subset of the index that we could
ever need based on the names of the packages we want to install. For
the common case of installing just one or two packages this cuts
down the number of packages we look at by a couple orders of
magnitude. This does not help with the installed index which is read
strictly, though most people do not (yet) have hundreds of installed
packages, so that's less of an immediate problem.

alphaHeavy/cabal,alphaHeavy/cabal