
Bryan Richter wrote:
I use nix-shell for choosing specific ghc environments, and undoubtedly a theoretical 'cabal shell' could work similarly. (In fact, Nix could probably produce a saner (shell) environment by using GHC environments, so the two solutions could converge.)
Consider the following hypothetical session:
$ cabal new-build # Creates .cabal.ghc.environment.arch-os-version, which is # non-default
$ cabal shell # sets GHC_ENVIRONMENT to # $PWD/.cabal.ghc.environment.arch-os-version and spawns shell [...] $ cabal shell --run 'ghc-pkg list' ... (same output as previous)
Note that cabal-install already provides a 'cabal exec' command which offers essentially that functionality for sandboxes, though in a different bikeshed color: $ cabal exec -- $SHELL $ cabal exec -- ghc-pkg list Cheers, Bertram