This is an old revision of the document!
Learn how to use first-class and higher-order functions:
You will again use DrRacket, which you should have downloaded and installed for the previous labs.
For this lab, you will need to reimplement the following functions from the previous lab using Racket's higher-order functions map
, filter
, or foldr
:
convertFC
check-temps1
check-temps
convert
duple
average
eliminate-larger
In addition, you will need to implement the following functions:
curry2
(define (curry2 func) ...)
where func
is a two-parameter function and the result is a curried version of that two-parameter function.
You again do not need to bulletproof the code to enforce proper inputs. Your code only needs to return correct values given correct inputs.
You may use other higher-order functions such as andmap
, ormap
, etc., but these are not required These short-circuit the map-and-fold process rather than performing all of the mapping and then folding the results.