
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

HW 14 Prof. Caldwell Due: 23 October 2008 COSC 3015
Exercise 0.1. Read the section in Bird on Rose trees (pgs 195 - 209)
Exercise 0.2. Write a Haskell program to sum up all of the values in a Rose tree. The type specification is:
sumRose:: (Num a) => Rose a -> a
You will need to write code to test your function.
Exercise 0.3. Write flatten for Rose trees with the following specification:
So for example:
flatten (Node 5 [Node 3 [], Node 7 [Node 8 [], Node 9 []], Node 4 []]) = [5,3,7,8,9,4]