We now recommend you use [Stack](http://haskellstack.org) instead, but the instructions are preserved here for those that might want a minimal install.
Gentoo keeps a "stable" (read: old) version of `cabal-install` in the Portage
tree, so you'll want to use `cabal-install` to install the more recent
version. Note that the backslashes are intentional.
```bash
$ \cabal update # The backslashes
$ \cabal install cabal-install # are intentional
```
You have now installed cabal on a global scale with portage, and locally in your
home directory with `cabal-install`. The next step is to make sure that when you
run `cabal` in a terminal, your shell will run the up-to-date version in your
home directory. You will want to add the following lines to your shell's
configuration file:
```bash
PATH=$PATH:$HOME/.cabal/bin
alias cabal="$HOME/.cabal/bin/cabal"
```
If you don't know what your shell is, more than likely, your shell is Bash. If
you use Bash, the file you will edit is `~/.bashrc`. If you use Z-shell, the
file is `~/.zshrc`. You can run the following command to find out what your
shell is.
```bash
echo $SHELL | xargs basename
```
I use zsh, so that command outputs `zsh` when I run it.
Once you do all of that, you'll want to install the additional tools `alex` and `happy`.
```bash
$ cabal install alex happy
```
Congratulations! You now have a working Haskell installation!
## Mac OS X
### 10.9
Install the [GHC for Mac OS X](http://ghcformacosx.github.io/) app, which
includes GHC and Cabal. It provides instructions on how to add GHC and Cabal to
your path after you've dropped the `.app` somewhere.
### 10.6-10.8
Do the binary distribution install described below with [this tarball](https://www.haskell.org/platform/download/2014.2.0.0/ghc-7.8.3-x86_64-apple-darwin-r3.tar.bz2).
Install GHC and Cabal from your package system, then add `~/.cabal/bin` to your `$PATH`. Finally update `cabal` and install the additional tools `alex` and `happy`.