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