- Due Monday, April 9: 2-49-2, 4, 2-53-2, 4, 2-58.
- Due Monday, March 5: the fourth, fifth, and sixth problem under (2) in the Peano Axioms handout.
- Due Monday, Feb. 20: Write the following Haskell functions
- for_all :: (a -> bool) -> [a] -> bool
for_all p [a1, ..., an] checks if all elements of the list satisfy the predicate p. That is, it returns (p a1) && (p a2) && ... && (p an).
- exists :: (a -> bool) -> [a] -> bool
exists p [a1, ..., an] checks if at least one element of the list satisfies the predicate p. That is, it returns (p a1) || (p a2) || ... || (p an).
- filter :: (a -> bool) -> [a] -> 'a list
filter p l returns all the elements of the list l that satisfy the predicate p. The order of the elements in the input list is preserved.
- partition :: (a -> bool) -> [a] -> ([a], [a])
partition p l returns a pair of lists (l1, l2), where l1 is the list of all the elements of l that satisfy the predicate p, and l2 is the list of all the elements of l that do not satis
- Due Monday, Feb. 6, handout problems 8, 10, 12, 14.
- Due Monday, Jan. 23, chapter 6, exercises 35, 37, 38, and 39.
- Due Monday, Jan. 16, chapter 6, exercise 3 (p. 125).
- for_all :: (a -> bool) -> [a] -> bool
