RE: [Haskell-cafe] Function application like a Unix pipe

Henning Thielemann
Since (a . b) x a $ b x a (b x)
are equivalent, do you also want to reverse function and argument in order to match argument order of . and $ ?
That is x (b . a) x b $ a (x b) a ?
I'm sorry, I'm not sure I understand your question. Are you asking whether one should be allowed to write x f instead of f x? I don't think anyone is advocating this, but is can be convenient to have an infix operator for this purpose. Chad Scherrer Computational Mathematics Group Pacific Northwest National Laboratory "Time flies like an arrow; fruit flies like a banana." -- Groucho Marx

On Wed, 23 Nov 2005, Scherrer, Chad wrote:
Henning Thielemann
writes: Since (a . b) x a $ b x a (b x)
are equivalent, do you also want to reverse function and argument in order to match argument order of . and $ ?
That is x (b . a) x b $ a (x b) a ?
I'm sorry, I'm not sure I understand your question. Are you asking whether one should be allowed to write x f instead of f x? I don't think anyone is advocating this, but is can be convenient to have an infix operator for this purpose.
I want to say, that the order of symbols for ($), (.) and function application is consistent. This is a fine thing. I think that shall not be distroyed by giving ($) and (.) reversed argument order. It's of course a good question, why (>>) and (>>=) have the opposite order of (.). Compare function application a b where a is applied to b with the monadic case b >>= a where a is applied to the result of b. This makes changing a non-monadic expression to a similar monadic expression more difficult. Why is there no (<<) and why is (=<<) not the default? The order of 'do {a;b;c}' is compatible with that of (>>). So we have the fundamental conflict, that usually function application is from right to left, but interpreting imperative statements is from left to right. I think that's a similar conflict like that of little endian and big endian.

On Wed, 2005-11-23 at 17:47 +0100, Henning Thielemann wrote: . . .
Why is there no (<<) and why is (=<<) not the default? The order of 'do {a;b;c}' is compatible with that of (>>). So we have the fundamental conflict, that usually function application is from right to left, but interpreting imperative statements is from left to right. I think that's a similar conflict like that of little endian and big endian.
There may be something to your functional/imperative conflict. I had occasion to develop a computational model of a theoretical state-transition machine that the inventors wanted to be able to program. My model used the standard trick of construing a parameterized operation as a function f : Arg1 -> ... -> Argn -> State -> State. By writing the (ML) code for the instructions in the curried form and using a reversed composition operator, I was able to provide a programmatic interface which could be laid out one instruction per line with the composition operators way off to the right in the comment column, just like assembler code! The inventors thought this was just wonderful (there's no accounting for taste, I guess :-). -- Bill Wood
participants (3)
-
Bill Wood
-
Henning Thielemann
-
Scherrer, Chad