Could you explain me step by step the result of the second instruction?
I know how foldr works in this cases:
foldr (*) 1 [-3..-1]
-6
But I don’t know how to deal with the function (\y z -> y*3 + z) in a foldr expression.
foldr (\y z -> y*3 + z) 0 [1..4]
30
Let’s look at the definition of foldr:
Now, in your example,
So, just using the definitions: