On Fri, Jul 31, 2015 at 2:32 PM, Evan Laforge <qdunkan@gmail.com> wrote:
On Fri, Jul 31, 2015 at 11:26 AM, Herbert Valerio Riedel
<hvriedel@gmail.com> wrote:
> Btw, I simply prepend to the $PATH env variable, or pass the appropriate
> executable name to `cabal`'s
>
>    -w --with-compiler=PATH            give the path to a particular compiler

I don't understand, aren't they all in /usr/local/bin?  Or do you use
a version-specific prefix when installing each ghc version?

You can specify just the executable name, in which case cabal will search $PATH; or specify an absolute or relative path. So

    cabal install -w ghc-7.10.2
    cabal install -w ghc-7.8.4
    cabal install -w $HOME/my-ghc-checkout/inplace/bin/ghc-stage2

I install the binary distributions with --prefix=$HOME, so that the binaries all end up in ~/bin and I can invoke the version I want easily in this fashion. The only thing I find missing is the ability to install a binary distribution without overwriting the existing symlinks (e.g. ghc -> ghc-7.8.4).

Regards,
Reid Barton