CSCI 189 - Assignment 7 Lab Work

The Problem set for this assignment is due 5:00pm November 8, 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/Asst7/Asst7.lhs from a Web browser and save this file as Asst7.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 -> Asst7.lhs The following text should appear in that window.

    ------------------------------------------------------
    Recursion, Recurrence Relations, and Haskell Functions
    Allen Tucker
    April 2004
    ------------------------------------------------------
    > module Asst7 where

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

Defining new functions in Haskell is a discipline that requires mastery of recursion and recurrence relations. This tutorial provides an introduction to recursion, recurrence relations, and defining functions in Haskell. The best way to learn from this tutorial is to try out (in the Haskell window) all lines that begin with "Asst7>" and then to modify this file to define new functions as they are discussed.