Introduction to Functional Programming – Installing HasteTDA555 / DIT440, LP1, HT2013
Home | Schedule | Labs | Exercises | Exam | AboutFire | Forum | TimeEdit | Links | 2012

Pre-installed Haste (Chalmers' computers)

Haste is already installed on Chalmers' computers (as of Oct 9, 2013; thanks to Guilhem). In order to get access to it, you need to make sure to have the directories
/chalmers/sw/unsup64/phc/b/binl
/chalmers/sw/unsup/phc/b/binl
in your path. One way to achieve this is to run the commands:
echo 'setenv PATH $PATH":/chalmers/sw/unsup64/phc/b/binl:/chalmers/sw/unsup/phc/b/binl"' >> $HOME/.tcshrc
echo 'export PATH=$PATH:/chalmers/sw/unsup64/phc/b/binl:/chalmers/sw/unsup/phc/b/binl'   >> $HOME/.bashrc
Restart the terminal to make sure that the new path is visible.

Note that if you run these commands several times, redundant lines will be added to you ~/.tcshrc and ~/.bashrc files. If so, you may want to clean them up afterwards.

If you have previously installed Haste using the manual method, you may need to remove the hastec binary from your ~/.cabal/bin directory in order to use the pre-installed version. Alternatively, you can just wipe out everything that has been installed locally by running

rm -r ~/.ghc ~/.cabal ~/.haste
Beware that this will also remove any other packages you have installed using Cabal.

Check that the setup works by running

> hastec --version
0.2.8

Manual installation

This method should work on any computer that has the Haskell Platform installed, including Chalmers' student computers. But note that it may take several minutes to complete on the student computers, and it will use up around 250 MB of disk space.

First, make sure to add ~/.cabal/bin to your path (this is a good idea regardless of whether you want to install Haste). On Chalmers' student computers, this can be done by running:

echo 'setenv PATH $HOME/.cabal/bin:$PATH' >> $HOME/.tcshrc
echo 'export PATH=$HOME/.cabal/bin:$PATH' >> $HOME/.bashrc
Restart the terminal to make sure that the new path is visible.

Next, run

cabal update
cabal install haste-compiler
haste-boot
Check that the installation works by running
> hastec --version
0.2.8