<div dir="ltr">I personally like this idea. Mathematica allows all sorts of bizarre names and it'd be cool for Haskell to be similar, so that mathematical Haskell scripts and IHaskell notebooks can be just as fancy and incomprehensible as dense Mathematica code!<div>

<br></div><div>Since GHC already accepts <i>some</i> unicode, I think it'd be a great idea to extend it in this way.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jun 14, 2014 at 4:58 PM, John Meacham <span dir="ltr"><<a href="mailto:john@repetae.net" target="_blank">john@repetae.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have this feature in jhc, where I have a 'trailing' character class<br>
that can appear at the end of both symbols and ids.<br>
<br>
currently it consists of<br>
<br>
 $trailing = [₀₁₂₃₄₅₆₇₈₉⁰¹²³⁴⁵⁶⁷⁸⁹₍₎⁽⁾₊₋]<br>
<br>
 John<br>
<div><div class="h5"><br>
On Sat, Jun 14, 2014 at 7:48 AM, Mikhail Vorozhtsov<br>
<<a href="mailto:mikhail.vorozhtsov@gmail.com">mikhail.vorozhtsov@gmail.com</a>> wrote:<br>
> Hello lists,<br>
><br>
> As some of you may know, GHC's support for Unicode characters in lexemes is<br>
> rather crude and hence prone to inconsistencies in their handling versus the<br>
> ASCII counterparts. For example, APOSTROPHE is treated differently from<br>
> PRIME:<br>
><br>
> λ> data a +' b = Plus a b<br>
> <interactive>:3:9:<br>
>     Unexpected type ‘b’<br>
>     In the data declaration for ‘+’<br>
>     A data declaration should have form<br>
>       data + a b c = ...<br>
> λ> data a +′ b = Plus a b<br>
><br>
> λ> let a' = 1<br>
> λ> let a′ = 1<br>
> <interactive>:10:8: parse error on input ‘=’<br>
><br>
> Also some rather bizarre looking things are accepted:<br>
><br>
> λ> let ᵤxᵤy = 1<br>
><br>
> In the spirit of improving things little by little I would like to propose:<br>
><br>
> 1. Handle single/double/triple/quadruple Unicode PRIMEs the same way as<br>
> APOSTROPHE, meaning the following alterations to the lexer:<br>
><br>
> primes -> U+2032 | U+2033 | U+2034 | U+2057<br>
> symbol -> ascSymbol | uniSymbol (EXCEPT special | _ | " | ' | primes)<br>
> graphic -> small | large | symbol | digit | special | " | ' | primes<br>
> varid -> (small { small | large | digit | ' | primes }) (EXCEPT reservedid)<br>
> conid -> large { small | large | digit | ' | primes }<br>
><br>
> 2. Introduce a new lexer nonterminal "subsup" that would include the Unicode<br>
> sub/superscript[1] versions of numbers, "-", "+", "=", "(", ")", Latin and<br>
> Greek letters. And allow these characters to be used in names and operators:<br>
><br>
> symbol -> ascSymbol | uniSymbol (EXCEPT special | _ | " | ' | primes |<br>
> subsup )<br>
> digit -> ascDigit | uniDigit (EXCEPT subsup)<br>
> small -> ascSmall | uniSmall (EXCEPT subsup) | _<br>
> large -> ascLarge | uniLarge (EXCEPT subsup)<br>
> graphic -> small | large | symbol | digit | special | " | ' | primes |<br>
> subsup<br>
> varid -> (small { small | large | digit | ' | primes | subsup }) (EXCEPT<br>
> reservedid)<br>
> conid -> large { small | large | digit | ' | primes | subsup }<br>
> varsym -> (symbol (EXCEPT :) {symbol | subsup}) (EXCEPT reservedop | dashes)<br>
> consym -> (: {symbol | subsup}) (EXCEPT reservedop)<br>
><br>
> If this proposal is received favorably, I'll write a patch for GHC based on<br>
> my previous stab at the problem[2].<br>
><br>
> P.S. I'm CC-ing Cafe for extra attention, but please keep the discussion to<br>
> the GHC users list.<br>
><br>
> [1] <a href="https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts" target="_blank">https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts</a><br>
> [2] <a href="https://ghc.haskell.org/trac/ghc/ticket/5108" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/5108</a><br>
> _______________________________________________<br>
</div></div>> Glasgow-haskell-users mailing list<br>
> <a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
John Meacham - <a href="http://notanumber.net/" target="_blank">http://notanumber.net/</a><br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>