CSci 555: Functional Programming
Fall Semester 1998
Assignment #4
Due Monday, 2 November
- Implement the Haskell functions specified in
exercise 8 on page 91 of
Notes on Functional Programming with Gofer.
The functions should not convert to and from the
built-in Haskell lists to implement the desired functionality.
-
Add the following functions to the package:
- toSeq converts a Haskell list into a Seq
with exactly the same elements in the same order. The Seq
should be "perfectly balanced", that is, the "tree" represented by
every Cat should be of minimal height.
- fromSeq converts a Seq into a
Haskell list with exactly the same elements in the same order.
- delSeq takes a value and a Seq of the same type
and returns the Seq with the value removed.
- Students taking this course for graduate credit: add type
Seq to the Eq and Functor classes.
This is optional for other students.
- For an extra challenge beyond the basic assignment, modify all the
functions in the package so that they only return Seq "trees" that
satisfy the AVL balancing criteria.
(Look this up in a book on data or file structures.)
-
Please format and document your program source code appropriately.
(All of the above functions should be defined in the same file.)
-
Test your programs appropriately and thoroughly.
-
When this assignment is complete, submit a paper listing of your
program source code and the screen outputs from executing the program.
Be sure that all items submitted are clearly labeled with your name
and the assignment number. Include the Honor Code statement as
described in the Assignments section of the Syllabus.
-
Also submit your program source code using EASE, the Electronic
Assignment Submission Environment, at URL
http://www.cs.olemiss.edu/submit/. Your username for that system
is your sunset account name. (If this system is not working for you,
send the files to me in email at cunningham@cs.olemiss.edu)
UP to CSCI 555 assignments document?
Copyright © 1999, H. Conrad Cunningham
Last modified: Wed May 12 11:08:33 CDT