Composition again

Simon Marlow marlowsd at
Tue Apr 29 17:05:58 EDT 2008

Simon Marlow wrote:
> Simon Marlow wrote:
>> Here are the possibilities for composition:
>> 0. do nothing
>> 1. use a Unicode operator for composition
>> 2. require spaces around . as an operator
>> 3. require spaces around all operators
>> 4. use another ASCII operator for composition, e.g. <<<
> Ok, I'm going to try to make some progress on this.  I think it's fair 
> to say that the only possible options are (0) do nothing, or (2) require 
> spaces around "." as an operator.

Yesterday I talked to John Launchbury, who had previously been strongly 
opposed to option (0), and we noticed that the proposed change to the 
syntax of qualified operators actually negates some of the concerns 
about dot.

The H98 report lists these examples:

f.g     f . g (three tokens)
F.g     F.g   (qualified `g')
f..     f ..  (two tokens)     *****
F..     F..   (qualified `.')
F.      F .   (two tokens)

that with the qualified operator change, this becomes:

f.g     f . g   (three tokens)
F.g     F.g     (qualified `g')
f.(.)   f . (.) (three tokens)  *****
F.(.)   F.(.)   (qualified `.')
F.      F .     (two tokens)

look at the example marked with *****.  With the new syntax it is no 
longer a weird exception: 'f..' is two tokens, whereas 'f.(.)' is three 
tokens just like 'f.g'.  The syntax is more regular.

John tells me he's happy to go with option (0) - make no other changes 
to dot - as long as we adopt the qualified operator change.  I'm 
comfortable with that position too.


More information about the Haskell-prime mailing list