Quiz Stuff

Quiz 5, February 12, 2018
2'30" (2 mins and 30 secs); 1 + 1 + 1 + ½ points; 3½ points total

  1. What are the characteristics of a higher order function?
  2. In broad terms, what does the map function do?
  3. In broad terms, what does the filter function do?
  4. In Haskell, what is a "section". (OK to just show an example of one.)
EC ½ point: Write an expression whose value is bottom.

Answers

  1. What are the characteristics of a higher order function?
    A function that takes or returns a function.
  2. In broad terms, what does the map function do?
    Applies a function to each element of a list, producing a list of the results
  3. In broad terms, what does the filter function do?
    Selects elements of a list that satisfy a predicate.
  4. In Haskell, what is a "section". (Ok to just show an example of one.)
    Short answer:(+1)
    Long answer: A partial application created by enclosing a binary operator and either operand in parentheses.
  5. EC: Write an expression whose value is bottom.
    length [1..]