There is some reason for this function:
foo f x y = f x y
foo x y = (+) x y
Return this error?
Equations for 'foo' have different numbers of arguments
Why does not Haskell allow this behavior?
There is some reason for this function:
foo f x y = f x y
foo x y = (+) x y
Return this error?
Equations for 'foo' have different numbers of arguments
Why does not Haskell allow this behavior?
Notice that in the first case you have 3 arguments (f, x, y), and in the second you have 2 arguments (only x and y).
If you wanted to specialize the application of f, then it is better to create another function. Ex:
foosum x y = foo (+) x y