small extension to `...` notation
Benjamin Franksen
benjamin.franksen at bessy.de
Thu Mar 9 07:30:22 EST 2006
On Thursday 09 March 2006 08:59, Bulat Ziganshin wrote:
> Hello Doaitse,
>
> Thursday, March 9, 2006, 12:01:37 AM, you wrote:
> DS> xs `zipWith (+)` ys
>
> i had the same desire several times
>
> > Possibly `(<expr>)` ?
>
> it will be non-readable. it is better to just prohibit using of
> backquotes inside backquotes. and fixity can be fixed at 0, imho.
>
> at least, my cases was just when i want to use two words inside
> backquotes instead of just one. and fixity should be 0 because such
> expression with space inside it should have a small priority because
> parts of expression "too distant" from each other
>
> (btw, i had (not serious) proposal to raise priority of operations if
> there is no spaces around it, so that the following:
>
> x:xs ++ y:ys
>
> translates to
>
> (x:xs)++(y:ys)
>
> in full accordance with natural reading)
I support this.
BTW, it reminds me of the language L, where there are 3 'symbols' for
application, each with a different precedence:
"A sequence of expressions separated by nothing, periods, or spaces
denotes an application (function call) where the function is the result
of the first expression and the arguments are the results of the
remaining expressions. The expressions are computed independently in
parallel. No separation has highest precedence, then period separation,
then space separation. Parenthesis can be used to override precedence.
Example application expressions are: x+2, x.+.2, x + 2, x + 4y, (x +
4)y + foo.bar."
(Quoted from http://www-static.cc.gatech.edu/~tony/L/)
Ben
More information about the Haskell-prime
mailing list