Repository navigation
Fix use of Unicode characters in Identifiers - #105
Conversation
adamgundry
left a comment
There was a problem hiding this comment.
At the risk of pedantry, perhaps a consistent phrase like "any Unicode character (in the categories | with the property) ..." would make it clearer where we are carving up subsets of the space?
Co-authored-by: Adam Gundry <adam@well-typed.com>
exaexa
left a comment
There was a problem hiding this comment.
Looks OK to me.
Vote +1 regardless of the ascDigit suggestion status.
|
I'm kinda with hesitant identifiers being allowed to with "other letters". Is anyone familiar with the rationale of GHC allowing this? |
The strict division of letters into lowercase and uppercase is a peculiarity of European scripts only. The Haskell report basically excludes the rest of the world's scripts from being used for identifiers: Arabic, Bengali, Chinese, etc. Haskell is already seen as elitist enough, there's no need to make it european-elitist. |
|
@blamario, sorry that typo was in a bad spot. I meant why identifiers should be allowed to start with other letters. I support other letters being allowed in identifiers in general. Is there a clear reason or history why other letters are effectively considered lower case rather then uncased (where "Modifier Letter (Lm)" and Non-Spacing Mark (Mn)" are in the proposal)? |
|
I think it is hard to reconstruct the historical reasoning, unless someone is able to find the old discussions. But I guess it is due to lowercase identifiers being more common in Haskell code and REPL sessions. In the type and constructor namespaces you probably have to then come up with a prefix like |
Superstar64
left a comment
There was a problem hiding this comment.
Alright, I don't really like characters being allowed to start with other letters, but it's not a deal breaker for me. Parity with GHC is more important here. Approving.
L0neGamer
left a comment
There was a problem hiding this comment.
lgtm; would it be worth putting examples of changes in what is and isn't accepted in the changelog?
I think we can do some editorial polishing of the Preface in the end and add additional examples. The Preface currently is mostly just a record of changes already merged. |
|
Including me (I cannot approve my own PR) I count 8 votes in favour. This is thereby accepted :) |
Fixes #4
Other Letter (Lo)instead ofother letter.uniIdcharandidcharnonterminals, as per the specification found in the GHC user guide.uniDigit. Note that after Fix #3 Exclude non-ASCII digits from decimal and hexit #67 we no longer useuniDigitin the syntax of numeric literals, only in the syntax of identifiers likefoo5.large = ascLarge | uniLarge(and similarly forsmall) is confusing, sinceascLargeis a subset ofuniLarge, so I have modified them.ascLargeis now only used in the definition ofcntrl, so I have moved it closer to there.ascSmallis now only used in the FFI chapter, so I have moved it there.