| | |
Summary: RHEINISCH
WESTF ˜
ALISCHE
TECHNISCHE
HOCHSCHULE
AACHEN
LEHR UND FORSCHUNGSGEBIET INFORMATIK II
RWTH Aachen · D52056 Aachen · GERMANY
http://wwwi2.informatik.rwthaachen.de/lufgi2
LuFG
Informatik II
Prof. Dr. J˜ urgen Giesl
Ren’e Thiemann
Exercises Functional Programming -- Sheet 3
Solutions will be collected until Thursday, Nov 7, 2002 in the exercise course.
Exercise 1 ( 1+2+1+2 points)
(i) Define a higherorder function filter :: (a>Bool) > [a] > [a]. The expression
filter f xs should return the list xs without those arguments that do not satisfy the pre
dicate f. For example, we have filter even [12,270,3,18,9,12] = [12,270,18,12].
(ii) Look at the following data structure:
|