[Haskell-cafe] Function application layout

Daniel Fischer daniel.is.fischer at googlemail.com
Thu May 26 18:10:35 CEST 2011


On Thursday 26 May 2011 17:22:10, Jonas Almström Duregård wrote:
> Unfortunately it does not play nice with $.

Yes.

> Also I'm not sure this can be used for defining trees or nested function
> application since a nesting of the operator inevitably require
> parenthesis.

It can't be nested, like ($) can't be nested. You could however add

infixl 1 ??
infixl 2 ???
...

to achieve the possibility of nesting (but you have to be careful with low-
precedence operators if you actually want to use that).

As far as I'm concerned, a left-associative version of ($) would sometimes 
be nice (on the other hand, right-associativity of ($) is sometimes also 
nice), but usually, I don't find parentheses too obnoxious.



More information about the Haskell-Cafe mailing list