CSCI 189 - Assignment 6 Lab Work

The Problem set for this assignment is due 5:00pm November 1, 2005.

Start Haskell by following the same procedure that you used in earlier labs.

  1. Open the file http://www.bowdoin.edu/~allen/courses/cs189/Asst6/Asst6.lhs from a Web browser and save this file as Asst6.lhs (do not append the .txt suffix) on the Desktop.
  2. Open two windows:

    (a) A Unix "Shell" where you can run Haskell programs: select Macintosh HD -> Applications -> Utilities -> Terminal

    (b) A text editor where you can edit Haskell programs: select Macintosh HD -> Applications -> TextEdit

  3. Line up these two window side by side so that you can see them both.
  4. Now switch to the right-hand window and open the tutorial lab exercise for this assignment by selecting File -> Open -> Asst6.lhs The following text should appear in that window.

    ------------------------------------------
    More about Defining Functions with Haskell
    Allen Tucker
    October 2004
    ------------------------------------------
    > module Asst6 where

  5. Now switch to the left-hand window and type the following two lines at the prompt:
    cd Desktop
    hugs Asst6

The properties of functions can be explored with the help of Haskell. This tutorial provides an introduction to defining functions in Haskell, as well as an interesting exercise in cryptography.