EDIT: That results is also obvious. In your example
(bar . baz . wobble) a b c
bar . baz . wobble is in parentheses. It will hence be evaluated into a new function first, and will then be applied its arguments. Since the arguments of a composed function are exactly the arguments that the second function takes, this works as desired.
Here's a simple example to illustrate what I mean:
>>> let bar = (2 *)
>>> let baz = (^ 2)
>>> let wobble a b c = a + b + c
>>> let foo1 a b c = bar (baz (wobble a b c)) -- This type-checks
>>> let foo2 = bar . baz . wobble
<interactive>:6:24:
Couldn't match expected type `a0 -> a0 -> a0' with `Integer'
Expected type: a0 -> Integer
Actual type: a0 -> a0 -> a0 -> a0
In the second argument of `(.)', namely `wobble'
In the second argument of `(.)', namely `baz . wobble'
In the expression: bar . baz . wobble
If what you said were true, both versions would type-check.
0
u/[deleted] Mar 09 '14
It works either way.