:10:6: lexical error at chara...">

What happened to this Unicode Haskell variable name?

What is wrong, this code?

Prelude> let xแต€ = "abc" <interactive>:10:6: lexical error at character '\7488' 

According to my reading of the Haskell 2010 report, any Unicode letter in upper or lower case must be valid at the end of the variable name. The แต€ ( MODIFIER LETTER CAPITAL T ) character cannot be a Unicode capital letter?

Is there a better symbol for representing transposing a vector? I would like to stay brief, as I value a dense mathematical formula.

I am running GHC 7.8.3.

+6
source share
2 answers

Unicode uppercase letters are in the Unicode character category Letter, Uppercase [Lu].

Unicode lowercase letters are in the Unicode character category. Letter, Lowercase [Ll].

CAPITAL MODIFICATION LETTER T is in the Unicode character category Letter, Modifier [Lm].

I tend to stick with ASCII, so I probably would just use a name like xTrans or x' , depending on the number of lines in the area.

+8
source

Characters not in ANY category are invalid in Haskell programs and should result in a lexing error.

Where

 ANY โ†’ graphic | whitechar graphic โ†’ small | large | symbol | digit | special | " | ' small โ†’ ascSmall | uniSmall | _<br> ascSmall โ†’ a | b | โ€ฆ | z<br> uniSmall โ†’ any Unicode lowercase letter ... uniDigit โ†’ any Unicode decimal digit ... 

Modifiers such as แต€ are not legal for Haskell. (Unlike superscript numbers or superscript numbers that are in the Number, Other category , so aโ‚ treated the same as a1 .)

I like to use Unicode without ASCII when it helps readability, but if you haven't assigned a different value to the first character already, using it here to transpose should be just fine.

+8
source

Source: https://habr.com/ru/post/972790/


All Articles