Haskell Installation Instructions

Rose-Hulman Institute of Technology
Dept. of Computer Science and Software Engineering

Overview

This page gives instructions for installing Haskell on Windows or Mac while on campus using a local copy of the Haskell Platform. If you are off-campus or installing on a Linux distro, you probably want to go directly to the the Haskell Platform website. Then come back here and try the steps to verify that your installation is working.

Installation Steps for Windows on Campus

  1. Download the Windows installer for the Haskell Platform.
  2. Run the installer and follow the instructions.
  3. Follow the steps below to see if your installation is working correctly.

Installation Steps for Macs on Campus

  1. Download the Mac disk image for the Haskell Platform.
  2. Open the disk image file (.dmg) and follow the instructions.
  3. Follow the steps below to see if your installation is working correctly.

Verify that your Installation is Working

Follow these steps to verify that your installation is working:

  1. Launch GHCi. (On Windows, you probably want Windows Menu → GHCi. Mac and Linux user can just type ghci at a shell prompt.) You should get a prompt like in the figure below.

    Screen shot of ghci prompt
  2. At the Prelude> prompt, enter 6 * 7 and press enter. You should get the answer.
  3. Enter :type "Hello, world" Note that you must type the leading colon before the word “type”. You should get back "Hello, world" :: [Char].
  4. Enter :quit to exit.
  5. On Windows, you’ll also want to install a decent text editor and configure GHCi to work with it:
    1. Download Notepad++ from SourceForge and install it in the usual way.
    2. Create a directory to store your Windows ghci configuration file. On Windows 7, the directory you create should be C:\Users\<UserName>\AppData\roaming\ghc.

      (On Windows XP create C:\Documents and Settings\<UserName>\Application Data\ghc.)

    3. In that directory, use Notepad++ to create a plain text file named ghci.conf.
    4. Put the following in the file:
      :set editor "C:\Program Files\Notepad++\Notepad++.exe"
      :cd <full path to the folder where you will put Haskell files>
      
      being sure to
      • start each line with a colon, :
      • use the correct path to your Notepad++ executable, wrapped in quotes
      • use the correct path to whatever folder you want to use for your Haskell programs WITHOUT quotes
    5. You can verify that this worked by quitting and relaunching ghci, then entering the following commands at the prompt:

      Prelude> :!chdir
      should display the path to your working folder
      Prelude> :edit foo.hs
      should launch Notepad++ for editing a new file named foo.hs
      

      Note: Launch Notepad++ before you launch ghci, that way ghci won't block waiting for Notepad++ to exit.

    6. If the previous step didn’t work, double-check each of the steps above. Once it does work, close Notepad++, use :quit to exit GHCi, and enjoy a refreshing beverage.