- Use a full sheet of 8½ x 11" paper. (Half sheet? Half credit!)
- Put your last name and first initial in the far upper left hand corner!
- No need to write out questions.
- Numbering responses may help you avoid overlooking a question; it's ok to go ahead and pre-number your sheet.
- Time: 3:30; five regular questions plus two EC questions
- Can everybody see this line?
Quiz 3; January 30; 3:30 minutes; 1+2+1+1+1 points
-
Rewrite the following expression, removing unnecessary parentheses:
f(x) + g(y) + (3*y)
- Rewrite the following function to use guards instead of
if-else
:
f x = if x > 3 then 10 else x
- Add parentheses to the following type expression to reflect the associativity of
->
a -> Int -> Char
- Recall that the
head
function returns the first element of a list.
What is the type of head
?
- What's the value of the following expression?
tail [3, 1, 5]
EC ½ point: What's the difference between Int
and Num
?
EC ½ point: :info ++
shows infixr 5 ++
. What's interesting about that?