这个Haskell unicode变量名称有什么问题? [英] What's wrong with this Haskell unicode variable name?
问题描述
这段代码有什么不对?
Prelude> letxᵀ=abc
< interactive>:10:6:字符'\7488'处的词法错误
据我的哈斯克尔2010年报告阅读,任何大写或小写Unicode字母应该在变量名的末尾有效。是否ᵀ
字符(修饰符字母大写T )不符合大写的Unicode字母?
是否有更好的角色来表示矢量的转置?
我正在运行GHC 7.8.3。 div class =h2_lin>解决方案
大写Unicode字母在Unicode字符类别Letter,Uppercase [Lu]中。
小写Unicode字母在Unicode字符类别Letter,Lowercase [Ll]中。
MODIFIER LETTER CAPITAL T是Unicode字符类别Letter,Modifier [Lm]。
我倾向于使用ASCII,所以我可能只使用一个名称,如 xTrans
或 x'
,具体取决于它在范围内的行数。
What's wrong this this code?
Prelude> let xᵀ = "abc"
<interactive>:10:6: lexical error at character '\7488'
According to my reading of the Haskell 2010 report, any uppercase or lowercase Unicode letter should be valid at the end of a variable name. Does the ᵀ
character (MODIFIER LETTER CAPITAL T) not qualify as an uppercase Unicode letter?
Is there a better character to represent the transpose of a vector? I'd like to stay concise since I'm evaluating a dense mathematical formula.
I'm running GHC 7.8.3.
Uppercase Unicode letters are in the Unicode character category Letter, Uppercase [Lu].
Lowercase Unicode letters are in the Unicode character category Letter, Lowercase [Ll].
MODIFIER LETTER CAPITAL T is in the Unicode character category Letter, Modifier [Lm].
I tend to stick to ASCII, so I'd probably just use a name like xTrans
or x'
, depending on the number of lines it is in scope.
这篇关于这个Haskell unicode变量名称有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!