Saturday, 8 August 2015

Haskell - updating GHC and leaving the Haskell platform

This was my first GHC update and since it made me spend a couple of minutes scratching my head and deciding on how to approach this, let me share my experience in the form of a Q&A for the sake of brevity.

Q: When to update my GHC?
A: Whenever you think you need a newer version. A good example would be: new hackage packages stop working (give installation errors) and require new versions of core packages like base.

Q: I am using Haskell Platform, how do I update GHC?
A: Simply download the latest GHC and make sure your PATH points at the updated version (and not at Haskell Platform). Fear not. Stepping away from, otherwise very useful, Haskel Platform will give you much more freedom and control over the packages you're using.

Q: I have the latest version of GHC installed. How do I update my PATH?
A: If you've been using the Haskell Platform until now, your PATH should point at two things located in the Haskell Platform:
  • GHC
    C:\Program Files (x86)\Haskell Platform\2013.2.0.0\bin
  • mingw
    C:\Program Files (x86)\Haskell Platform\2013.2.0.0\mingw\bin
To leave the Haskell Platform's GHC and start using the new one, simply update the PATH accordingly (depending on where you installed the latest GHC):
  • GHC
  • mingw

This should get you access to the latest Haskell packages. Please share if your experience was different or if you follow a simpler process.

Happy hacking!

No comments:

Post a Comment