This guide assumes, that you have the brilliant Homebrew installed. If not, I recommend that you go to the Homebrew homepage and install it first.
Resetting Cabal and GHC package database
Sometimes you fiddle around your installation, and end up with messed up system that won't compile anything non-trivial. Cabal might have gotten into twist. In this case, the easiest solution sometimes is to do a reset and reinstall. It won't take much time, but allows you to have clean slate.
Magic incatations needed for cleanup are following:
brew uninstall haskell-platform ghc
rm -rf ~/.ghc ~/.cabal
These commands uninstall
ghc (the haskell compiler) and
haskell-platform (the standard library) and remove local databases.
Set up Haskell
ghc (if brew formula for ghc is missing, it's likely that ghc has been rolled into haskell-platform).
brew install ghc haskell-platform
After the haskell-platform has been installed, update cabal database with command
Add cabal binaries to PATH
This step depends a lot on your default shell. For
~/.bashrc to an editor of your choice, and add following line to the end:
Next, take the new PATH to use with command
Now you should have a working Haskell installation. Please note that sometimes your cabal installation may go corrupt (unsatiable or conflicting dependences) - in this case, you may need to use the reset described in the (first section.