CSCI 189 - Assignment 4 Lab

The Problem set for this assignment is due at 5:00pm October 4, 2005.

Start Haskell using the following steps (these are similar to the ones you used in Assignments 1 and 3).

  1. Open the file http://www.bowdoin.edu/~allen/courses/cs189/Asst4/Asst4.lhs from a Web browser and save this file as Asst4.lhs (do not append the .txt suffix) on the Desktop.
  2. Open the file http://www.bowdoin.edu/~allen/courses/cs189/Asst4/Set.lhs from a Web browser and save this file as Set.lhs (do not append the .txt suffix) on the Desktop.
  3. 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

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

    ---------------------------------------------------------
    Exploring Properties of Sets and Relations with Haskell
    Allen Tucker
    January 2004
    ---------------------------------------------------------

    > module Asst4 where

    > import Set

    The properties of sets and relations can be explored with the help of Haskell. Due to the limitations of the keyboard, some set operators (such as "intersection") have to be typed using two characters rather than one. Here is a brief summary of the differences in set notation between your book and Haskell.

  6. Now switch to the left-hand window and type the following two lines:
This will start Haskell running, and it will look something like this.

You will find that this tutorial provides some valuable tools for exploring the properties of sets using Haskell.