Functional Languages - Homework 8 Practice Problem | CS 457, Assignments of Computer Science

Material Type: Assignment; Class: FUNCTIONAL LANGUAGES; Subject: Computer Science; University: Portland State University; Term: Fall 2005;

Typology: Assignments

Pre 2010

Uploaded on 08/19/2009

koofers-user-q7w
koofers-user-q7w 🇺🇸

9 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 457/557 Homework 8 due 2pm, Tuesday, November 29, 2005
Hand in your solution on paper and email it to [email protected]. It should be placed in
a file called hw8.hs, which should be an attachment.
Choose a small programming problem of interest to you, and solve it in Haskell. You should aim
for something that can be coded naturally in 1-2 pages. Your solution must make significant use of
at least two of the following language features:
new algebraic data types and pattern matching (lists don’t count)
functions as data structures (like representing a set by its membership function)
type classes (you must define new classes or at least new instances)
lazy evaluation
monads (if you’ve been reading ahead; the IO monad doesn’t count)
It is acceptable to recode a problem that you have previously solved for another class (as long as
you didn’t use Haskell to solve it that time!). As usual, if you borrow an algorithm or some other
aspect of your solution from another source, you must cite it.
If you are really at a loss for ideas, consider doing one of the open-ended exercises from Hudak
Chapter 15 (reactive animations) or 20-23 (music composition). But be warned that these require
mastering non-trivial amounts of infrastructure.
Make sure to include comments in your program specifiying what it is expected to do, and how to
run it.
1

Partial preview of the text

Download Functional Languages - Homework 8 Practice Problem | CS 457 and more Assignments Computer Science in PDF only on Docsity!

CS 457/557 Homework 8 – due 2pm, Tuesday, November 29, 2005

Hand in your solution on paper and email it to [email protected]. It should be placed in a file called hw8.hs, which should be an attachment.

Choose a small programming problem of interest to you, and solve it in Haskell. You should aim for something that can be coded naturally in 1-2 pages. Your solution must make significant use of at least two of the following language features:

  • new algebraic data types and pattern matching (lists don’t count)
  • functions as data structures (like representing a set by its membership function)
  • type classes (you must define new classes or at least new instances)
  • lazy evaluation
  • monads (if you’ve been reading ahead; the IO monad doesn’t count)

It is acceptable to recode a problem that you have previously solved for another class (as long as you didn’t use Haskell to solve it that time!). As usual, if you borrow an algorithm or some other aspect of your solution from another source, you must cite it.

If you are really at a loss for ideas, consider doing one of the open-ended exercises from Hudak Chapter 15 (reactive animations) or 20-23 (music composition). But be warned that these require mastering non-trivial amounts of infrastructure.

Make sure to include comments in your program specifiying what it is expected to do, and how to run it.