[Haskell-cafe] Switching GHC Version

HASHIMOTO, Yusaku nonowarn at gmail.com
Tue Feb 7 00:27:51 CET 2012


Hi, I wrote a simple shell function for switching GHC version on the
system. It works only under Mac OSX, and only switch GHCs installed
via .pkg installers. It's useful to experiment newer features without
worrying breaking environment.

GHC_BASE_DIR=/Library/Frameworks/GHC.framework/Versions/

ghcs () {
  VERSION=$1
  sudo $GHC_BASE_DIR/$VERSION/Tools/create-links . /Library/Frameworks /
}

Usage:
~/work/today 08:21 ghcs 7.4.0.20111219-x86_64
Password:
~/work/today 08:21 ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.0.20111219
~/work/today 08:21 ghcs 7.4.1-x86_64
~/work/today 08:22 ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.1

Now I'm curious of better way to achieve this. This have limitations
described above. Even it requires sudo because it modified symbolic
links under `/usr`.

Suggestions?
-nwn



More information about the Haskell-Cafe mailing list