I find it unnatural (and irritating) that:
[False ..] ==> [False, True]
[false..] where false = False ==> [False, True]
(Just . Just) 1 ==> Just (Just 1)
(just.just) 1 where just = Just ==> Just (Just 1)
but [False..]
and (Just.Just) are illegal.
I suspect that the authors of both the Report and the Gentle Introduction
also (unconsciously) considered this unnatural, since both exhibit illegal
examples. Evidence:
Report, App D: "[Orange..]"
Gentle Introduction 8.2: "[Red..Violet]"
8.4: "[Wednesday..Friday]" and "[Monday..Wednesday]"
I expect the inconsistency could also be a little distracting for newcomers
(especially if they're teaching themselves from the tutorial examples),
because they're likely to encounter this long before they have any need for
qualified names, so the difference may seem more arbitrary than it is.
If qualified names are formed with periods, and '.' is a legal varsym
(in particular Prelude.. illustrates both) then I suppose we're stuck with
such inconsistencies.
In the Standard Haskell mail archive someone (I think Simon Peyton-Jones?)
once raised the possibility of adopting '#' for composition, with the threat
of subsequently stealing '.' for field selection in records. I wouldn't like
to give up '.' for composition; it's concise, and the closest approximation
to the traditional symbol. The other approximation suggested, " `o` ", I
dislike for two reasons: it's three times as long, and single character
names are often used for local variables ( ... where (m,n,oops,p,q) = ...)
What would be the consequences of:
1. Disallowing '@' as the leading character of a varsym
2. Using '@' to form qualified names (since '@' is already a reservedop,
and a "Module@" prefix could never be confused with "aspatname@")
apart from:
1. Massive breakage for compiler and library implementors and documentors
2. Minor breakage for users, who use qualification seldom
3. Loss of a few operator names ("@+", "@@", etc.)
4. Use of a less traditional connective for qualification.
Someone once lamented the lack of a Design Rationale document for the
original language decisions, to prevent just the type of question posed
above, on issues which must have been extensively chewed-over at the time.
TWP