[Haskell-cafe] Function Precedence

Hans Aberg haberg at math.su.se
Tue Apr 1 10:08:43 EDT 2008


On 1 Apr 2008, at 12:40, PR Stanley wrote:
> Why can't we have function application implemented outwardly  
> (inside-out). So
> f g x would be applied with
> gx first followed by its return value passed to f instead of  
> putting g x in brackets.

It seems me it may come from an alteration of math conventions:  
Normally (x) = x, and function application is written as f(x), except  
for a few traditional names, like for example sin x. So if one  
reasons that f(x) can be simplified to f x, then f g x becomes short  
for f(g)(x) = (f(g))(x).

It is just a convention. In math, particularly in algebra, one  
sometimes writes "f of x" as x f or (x)f, so that one does not have  
to reverse the order for example in diagrams.

   Hans Aberg




More information about the Haskell-Cafe mailing list