[Haskell-cafe] Function Precedence
Henning Thielemann
lemming at henning-thielemann.de
Wed Apr 2 05:22:31 EDT 2008
On Tue, 1 Apr 2008, Hans Aberg wrote:
> 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).
In functional analysis you write e.g. D f(x) meaning (D f)(x) not D(f(x)),
so I wouldn't say there is any convention of precedence of function
application in mathematics. Even more, in functional analysis it is common
to omit the parentheses around operator arguments, and since there are a
lot of standard functions like 'sin', I wouldn't say that using argument
parentheses is more common than omitting them. (Btw. in good old ZX
Spectrum BASIC it was also allowed to omit argument parentheses.)
More information about the Haskell-Cafe
mailing list