[Haskell-cafe] Unicode silliness
David Turner
dct25-561bs at mythic-beasts.com
Thu Jul 13 10:29:53 UTC 2017
Hi,
One of my colleagues asked about using Unicode symbols in Haskell operators
and I initially thought that this was supported.
However, the code at the bottom of this message doesn't parse, reporting a
lexical error on basically all of the funny characters of the form:
Main.hs:1:5: error: lexical error at character '\65288'
Character 65288 (0xff08) is punctuation [Ps] which I understand to mean it
counts as a uniSymbol in the lexical structure described in the Haskell
Report.
https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-160002.2
Should this work? Not that I really want this specific example to work, but
I'm interested to know why.
Many thanks,
David
$ cat app/Main.hs
foo (›’-’)› bar = False
foo ‹(’-’‹) bar = False
foo ∧(’-’)∧ bar = False
foo ∨(’-’)∨ bar = False
$ cat app/Main.hs | base64 # try and avoid mangling in email
Zm9vIO+8iOKAuuKAmS3igJnvvInigLogYmFyID0gRmFsc2UKZm9vIOKAue+8iOKAmS3igJnigLnv
vIkgYmFyID0gRmFsc2UKZm9vIOKIp++8iOKAmS3igJnvvIniiKcgYmFyID0gRmFsc2UKZm9vIOKI
qO+8iOKAmS3igJnvvIniiKggYmFyID0gRmFsc2UK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170713/e77a9c56/attachment.html>
More information about the Haskell-Cafe
mailing list