[an error occurred while processing this directive]

COMP1711 - installing GHCi

Because of the problems getting the homecomputing CD I've written some brief installation instructiond for you. It should all work with a bit of fiddling. If you have problems persevere. All else fails ask your tutor at your first tutorial.

Which version of GHC?

Because the 2003 version is big - if you don't have cable you might want to install last year's version which (a) is smaller, (b) is more or less the same as this year's version, and (c) you can get on CD if you can find one of the 2002 homecomputing CDs.

Note: if you have a Mac, click here.

Step 1

If you don't have win2000 or XP download the microsoft installer.

Save it to a directory somewhere (or the desktop), then double click on it in file manager/my computer if it doesn't install automatically (or if you saved it on the desktop double click on its icon on the desktop).

Agree to all questions

Step 2

Save it to a directory somewhere (or the desktop), then double click on it in file manager/my computer if it doesn't install automatically. (or if you saved it on the desktop double click on its icon on the desktop).

Agree to all questions - do the default install.

Note the name of the directory you install it in - at the end of the install process it will remind you to add this directory to your path (see step 3).

Step 3

If you installed it in blah you need to add blah\bin to your path. (if you accepted the default install it should be C:\ghc\ghc-5.04.2\bin for the 2003 version and probably somthing like C:\ghc\ghc-502.2\bin for the 2002 version). Write it down.

Adding things to the path is different in different versions of windows.

The following should work for most versions of windows. Otherwise ask around.

Open "System Properties" window (eith via control panel or start my computer and right click on the icon in the top left of the window and select properties)

Select "Environment variables" (on the "Advanced" tab)

Look at system variables. If there already is an entry for "Path" then add

 ;blah\bin
to the end of it (the ; is used to separate entries) If there is no entry for Path then create ("New") a new variable called "Path" and give it the value
blah\bin

Remember what blah means. Don't literally type "blah"...

Step 4

Create a directory you will store your programs in. Eg C:\comp1711\myPrograms

Find blah\bin in File Manger/My Computer and drag ghci.exe to your desktop holding down the Alt key as you do it (this makes a shortcut to it)

Right click on the shortcut and select Properties.

Change "Start in:" to be your directory for haskell programs from above (eg C:\comp1711\myPrograms). Now when you start ghci by clicking on the shortcut icon it will look for programs in here. Just make sure you save any haskell programs you write (using notepad or context) in this direcory.

Step 5

Test it out. Copy the module we wrote in lectures into your C:\comp1711\myPrograms directory. Start ghci by clicking the shortcut on your desktop. Be amazed at the hi-tec logo. type

:l Test.hs
and it should load the module.

Fiddle away to your hearts content.

Instructions for Mac Users

These instructions kindly provided by Raviraj Joshi.

Step 1

If you don't have Mac OSX 10.2, you'll need to upgrade to it, as ghc is not supported vor earlier Mac OS versions.

Step 2

Download the Mac version of GHC from the HomeComputing CD site or from www.haskell.org.

Step 3

Double-click the downloaded file and follow the online instructions. Simple! Note that the Mac version does not come with documentation, but documentation can be found on the www.haskell.org website.

[an error occurred while processing this directive]