I’ve got an idea:
allow for a global configuration of all the packages that are included by default by cabal or even loaded by ghc.
This includes
- The configured list of packages is by default in cabal
build-depends
- That list of packages is by default loaded by ghci (as if we had written
ghci -package A -package -B
- When compiling ghc modules without cabal the “default packages” are also made available implicitly (
-package
) -
cabal repl
loads the default packages too
Implementation wise:
- for cabal this should not be a problem, since cabal manages its own set of package databases, so all packages specified in the default configuration would be in reach
- for ghc it is not so simple: ghc uses a global package database (configured at install time) which often just has the boot packages (
containers
et all). Specifying, in the said default package list, packages already included in the global database would be trivial, but to access packages not installed in the global pkg DB I’m not sure - either we disallow it or allow specifying additional package databases there? not simple. - a third option is for ghc to simply load all packages it recognizes, while cabal will load them all and even install them if they aren’t yet available
Ultimately, though, I think regardless of that ghc pkgdb complication, this could work out well — and that said default list of packages could be itself, by default, the list that has been implicitly discussed here, which I think comprises just of packages already available in the global pkgdb