CS 119 Lab 8Abstract Data Type : Set

Objectives

  • Create another representation for the ADT Set
  • Perform the following tasks in the order given.

    1. Download the Lab8 project and import it into Eclipse as a Haskell project.
       
    2. Test out the examples functions from the notes and make sure you understand how they work.  For ease of experimentations, I have renamed the modules Set1 and Set2.  You can simply change the import statement in the Example8 module to change the representation that is being used.
       
    3. Sets can be represented by boolean-valued functions.  To make it easier to determine whether the set is empty or not, we will also include an integer value representing the size of the set.

      type Set a = (Int, a -> Bool)

      Assignment:
      Write all the operations for this new representation of a set.  Create a new module for this representation.

       

    4. Email your modified zipped project to me for grading.