Get Haskell and Cabal from https://www.haskell.org/platform/ or your distro's repositories, and make sure cabal is at least version 1.18.
Make sure ~/.cabal/bin is early in your path, then:
$ cabal update
$ cabal install happy
$ cabal install alex
$ cabal sandbox init
$ cabal install --enable-tests
$ cabal configure --enable-tests
If cabal install
only gives you a list of packages, then use this command
instead:
$ cabal install --enable-tests --force-reinstall
In the parent directory:
$ cabal build
In the parent directory:
$ cabal test