At 00:59 -0700 1999/07/01, Mark P Jones wrote:
>| Quick quiz:  how many Haskell lexemes are represented by the following
>| sequences of characters?
>|
>|      1)      M.x
>|      2)      M.let
>|      3)    M.as
>|      4)      M..
>|      5)      M...
>|      6)      M.!
>
>Interesting examples!  However, I don't agree with your proposed fix, which
>is to regard all of them as single lexemes.  Instead, I think that the time
>has come to find another symbol for composition, and let `.' be a token all
>by it's lonesome with the traditional reading of selection.

...
>Look at the contortions that we're making to keep . for function
>composition!
>It has to go!  How about ; instead as a nice syntax for forward composition?
>(Explicit layout?  What's that?  Maybe it should go too :-)

I think the problems are due to the rather limited supply of symbols that
ASCII supplies. When Unicode can be used, those problems will go away. For
example,
    .
    ..
    ...
would each be represented as a single symbol.

As for function composition, which one in math writes (f o g)(x) :=
f(g(x)), I decided to use a filled circle instead of the (*) in f * g := g
o f. As it is associative, it can be viewed as a kind of multiplication,
and I think that the symbol chosen should reflect that fact.

Could one not use parenthesizes to indicate the intent:
    M.....        -- M followed by .....
    M.(..)(...)   -- M followed by . .. ... (four lexemes)

If one permits dropping the parenthesizes even when not appropriate, then
one ends up with figuring out the meaning of strange syntaxes.

  Hans Aberg
                  * Email: Hans Aberg <mailto:[EMAIL PROTECTED]>
                  * Home Page: <http://www.matematik.su.se/~haberg/>
                  * AMS member listing: <http://www.ams.org/cml/>




Reply via email to