First remove any GHC, especially if you installed the platform edition. There is a script (https://gist.github.com/katychuang/9939239#file-removehaskellplatform-sh), which you should run in your terminal.
GHC
- Download GHC 7.8.3 binary
Download GHC 7.6.3 binary - Unpack the archived file
- Read the INSTALL file for the directions
- Run
./configure - Run
make install - Verify that it works with
ghc --version
Cabal
- Install cabal
- Link the cabal app to the location
~/.cabal/bin
GCC
# Link gcc compiler version
$ brew install gcc-4.2
$ which gcc-4.2
$ vim /usr/local/lib/ghc-7.6.3/settingschange the 2nd line to..
("C compiler command", "/usr/local/bin/gcc-4.2"),
Full instructions on this page
a few more things*
# needed for binary installs
cabal install happy
cabal install alex
# update cabal version
cabal install cabal-installHere's what your settings should look like
$ which ghc
/usr/local/bin/ghc
$ which cabal
~/.cabal/bin/cabal
$ which gcc-4.2
/usr/local/bin/gcc-4.2
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
$ cabal --version
cabal-install version 1.18.0.3
using version 1.18.1.3 of the Cabal library
# Note: as of 4/20/2014 the newest cabal version is 1.20 http://blog.johantibell.com/2014/04/announcing-cabal-120.html
A haskell project will contain a *.cabal file that lists the dependencies needed. The installations of these libraries are streamlined with the existence of Hackage and cabal package manager. You would run the command 'cabal install' to install dependencies and 'cabal build' to compile the code into a distributable application.
More information about using cabal can be found in the cabal guide.