#1102: Lambda unicode character lex
-----------------------------------------------+----------------------------
Reporter: humasect | Owner:
Type: bug | Status: reopened
Priority: normal | Milestone: 6.6.1
Component: Compiler (Parser) | Version: 6.6
Severity: minor | Resolution:
Keywords: lambda unicode lexical parse ? | Difficulty: Easy (1 hr)
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
-----------------------------------------------+----------------------------
Changes (by pumpkin):
* status: closed => reopened
* resolution: wontfix =>
* severity: major => minor
Comment:
Replying to [comment:1 simonmar]:
> I removed the claim on the Haskell-prime wiki, and also removed the
failed attempt to support unicode lambda from GHC.
>
> Further discussion is needed here: since λ is a lower-case letter, λx is
an identifier. If we want to treat this as meaning `\x`, that means λ
would need to be treated as a "special" character (like parentheses for
example). No other alphanumeric character has this property, currently.
I'm reasonably sure this could be done unambiguously for the regular greek
lambda, but it would add some complexity to the parse. As a simple
alternative, we could use some of the new unicode characters from the
"Math Alphanumeric Symbols" table (non-BMP). The following characters seem
like valid candidates for really easy lexing (unfortunately almost no
fonts actually provide glyphs for them, but in principle at least, it
should be correct:
𝛌 (1D6CC, MATHEMATICAL BOLD SMALL LAMBDA)
𝜆 (1D706, MATHEMATICAL ITALIC SMALL LAMBDA)
𝝀 (1D740, MATHEMATICAL BOLD ITALIC SMALL LAMBDA)
𝝺 (1D77A, MATHEMATICAL SANS-SERIF BOLD SMALL LAMBDA)
𝞴 (1D7B0, MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL LAMBDA)
What do people think? Would making all these characters lex to behave like
a \ be correct behavior? It would still be nice to get the regular BMP
greek lambda to have special behavior when to the left of a -> (or
equivalent unicode character) but that's a little context-sensitive.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1102#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs