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
-7
20
-20
7
2. What is the result of evaluating the following expression?
map (\x -> length x) ["This","is", "a","test"]
4
an error
[4,2,1,4]
3. What is the result of evaluating the following expression?
(\x -> (\y -> y x)) "x" (\y -> y)
"x"
(\x -> (\y -> y x)) "x"
an error
(\y -> y x) "x"
4. What is the result of evaluating the following expression?
(\x -> (\y -> x y)) "x"
a type error
a partially applied function
a string value
5. What is the result of evaluating the following expression?
(\x f -> f x) 4 (\x -> x*x)
a partially applied function
16
4
6. What is the result of evaluating the following expression?
(\x -> 1) 2
a type error
2
1
Submit Quiz