[Haskell-cafe] Function application like a Unix pipe

Bill Wood william.wood3 at comcast.net
Wed Nov 23 14:43:06 EST 2005


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




More information about the Haskell-Cafe mailing list