Given the following function
multThree :: (Num a) => a -> a -> a -> a
multThree x y z = x * y * z
and this description of it:
What really happens when we do
multThree 3 5 9
or((multThree 3) 5) 9
? First, 3 is applied tomultThree
, because they're separated by a space. That creates a function that takes one parameter and returns a function. So then 5 is applied to that, which creates a function that will take a parameter and multiply it by 15. 9 is applied to that function and the result is 135 or something. Remember that this function's type could also be written asmultThree :: (Num a) => a -> (a -> (a -> a))
.
I interpret this as follows and want to be sure that this is correct:
((multThree 3) 5) 9 =
((3*y*z)5)9 =
(15*z)9 =
15*9
= 135
Is this the correct interpretation of multThree
's functionality as described in this paragraph?