Hi Manuel,
"Manuel M. T. Chakravarty" wrote:
>
> Is there any good reason for the standard prelude defining
>
> infixr 0 $, $!, `seq`
>
> ie, making $ and $! right associative?
...
> I'd rather prefer
>
> f $ x $ y = (f $ x) $ y
>
> ie, ($) is like application by juxtaposition, but changes
> the precedence level (not the associativity). Whereas `f $
> x $ y' may be rare, I sometimes like to write `f $! x $! y'
> meaning `f x y' with strict application.
I think the idea behind $ is exactly the change of associativity.
I use $ a lot to save a lot of brackets. I very much prefer
f $ g $ h $ i $ j $ x
to
f (g (h ( i ( j x))))
and even to
(f . g . h . i . j) x
Note that f,g,h,.. are usually expressions which contain brackets themselves.
So saving the brackets of the assembly line makes matching of the remaining
brackets easier for writer and reader.
So I fear you have to define your own operator for strict multi-argument
application.
Cheers,
Olaf
--
OLAF CHITIL, Lehrstuhl fuer Informatik II, RWTH Aachen, 52056 Aachen, Germany
Tel: (+49/0)241/80-21212; Fax: (+49/0)241/8888-217
URL: http://www-i2.informatik.rwth-aachen.de/~chitil/