On Fri, Jul 31, 2015 at 10:31 PM Erik de Castro Lopo <mle+hs@mega-nerd.com> wrote:
I maintaing multiple versions of GHC on all the machines I use regularly
for Haskell development. I have:

* ghc-7.6.3 installed under /usr/lib/ghc-7.6/
* ghc-7.8.4 installed under /usr/lib/ghc-7.8/
* ghc-7.10.2 installed under /usr/lib/ghc-7.10/

To switch between versions all I need to do is modify $PATH
to remove say /usr/lib/ghc-7.6/bin and add /usr/lib/ghc-7.10/bin.
This lets me have two terminal window side by side with different
versions of GHC.

I actually have a shell function to to do this PATH mangling. I can
document this more fully if anyone is interested.


I have a similar setup where I install different versions of GHC in different directories. But I use GNU stow[1] to create and remove symlinks in /usr/local/* so that I can use one version of GHC as the default.

[1] https://www.gnu.org/software/stow/

Josef