| ... | ... | @@ -5,16 +5,19 @@ In early Haskell, . was used as function composition. In later versions of Haske |
|
|
|
|
|
|
|
|
|
|
|
These two uses do not fit well together, leading to special lexical rules (P11 of the report). As a test, before reading the report, can you lex the following: "f.g", "F.g", "F . g", "f..", "F..", and "F.". I couldn't.
|
|
|
|
(See [QualifiedIdentifiers](qualified-identifiers) for a related problem.)
|
|
|
|
|
|
|
|
|
|
|
|
Proposed syntaxes for [RankNTypes](rank-n-types) and [ExistentialQuantification](existential-quantification) also use . as a special symbol.
|
|
|
|
|
|
|
|
## Proposal
|
|
|
|
|
|
|
|
|
|
|
|
Reserve . for use as a qualifier in names. Do not permit . as an operator symbol. (Also continue to permit it as a decimal point in floats).
|
|
|
|
Reserve . for use as a qualifier in names. Do not permit . as an operator symbol (or as a symbol character?). (Also continue to permit it as a decimal point in floats).
|
|
|
|
|
|
|
|
## Pros
|
|
|
|
|
|
|
|
|
|
|
|
Much much simpler. Not impossible to remember.
|
|
|
|
- Much much simpler. Not impossible to remember.
|
|
|
|
|
|
|
|
## Cons
|
|
|
|
|
| ... | ... | |