Functional Programming (H) - 6.07 - We Love Lambda!
1. What is the result of evaluation of the following expression?
(\x y -> x*x-y*y) 3 4
-20
-7
7
20
2. What is the result of evaluating the following expression?
map (\x -> length x) ["This","is", "a","test"]
4
[4,2,1,4]
an error
3. What is the result of evaluating the following expression?
(\x -> (\y -> y x)) "x" (\y -> y)
(\y -> y x) "x"
an error
"x"
(\x -> (\y -> y x)) "x"
4. What is the result of evaluating the following expression?
(\x -> (\y -> x y)) "x"
a partially applied function
a string value
a type error
5. What is the result of evaluating the following expression?
(\x f -> f x) 4 (\x -> x*x)
16
4
a partially applied function
6. What is the result of evaluating the following expression?
(\x -> 1) 2
2
a type error
1
Submit Quiz