[Haskell-cafe] Function Precedence

Hans Aberg haberg at math.su.se
Wed Apr 2 05:59:57 EDT 2008


On 2 Apr 2008, at 11:22, Henning Thielemann wrote:
>> 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.

When I take a quick look into Hörmander's book on distributions, then  
he writes (D f)(phi), and not D f(phi). So there might be a  
difference between math that is drawn towards pure or applied math.

> 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 think that in RTL, one do that as well: x tau, instead of (x)tau.

> ...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.)

Math usage is probably in minority these days. As I noted, looking  
into books on axiomatic set theory, one construct tuplets it so that  
(x) = x. So it seems possible, although for function application f(z)  
seems the normal notation.

But one should also be able to write (f+g)(x). - This does not work  
in Haskell, because Num requires an instance of Eq and Show.

   Hans



More information about the Haskell-Cafe mailing list