Unicode characters in function names: some don't work?

Hi! say I wanna use "—" as new infix operator: it's the big dash used a bit like parenthesis, especially at the end of sentences —like this. in ghci directly: Prelude> let (—) a b = a + b No problem, is accepted and usable. Same in files. Now I try using (»), a French (amongst others) punctuation sign, typically replaces the quote-ends, « like this ». Doesn't work: <interactive>:2:6: lexical error at character '\187' I thought Haskell was Unicode-friendly? Why some symbols but not others? :'(

I think it has something to do with which unicode symbols are punctuation.
Check out this StackOverflow answer:
http://stackoverflow.com/questions/10548170/what-characters-are-permitted-fo...
On Wed, Apr 13, 2016 at 12:33 PM, Silent Leaf
Hi!
say I wanna use "—" as new infix operator: it's the big dash used a bit like parenthesis, especially at the end of sentences —like this.
in ghci directly: Prelude> let (—) a b = a + b
No problem, is accepted and usable. Same in files.
Now I try using (»), a French (amongst others) punctuation sign, typically replaces the quote-ends, « like this ». Doesn't work: <interactive>:2:6: lexical error at character '\187'
I thought Haskell was Unicode-friendly? Why some symbols but not others? :'( _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

And to see if a character is punctuation, use the handy isPunctuation
function
https://hackage.haskell.org/package/base-4.8.2.0/docs/Data-Char.html#v:isPun...
On Wed, Apr 13, 2016 at 4:50 PM, Tim Perry
I think it has something to do with which unicode symbols are punctuation.
Check out this StackOverflow answer:
http://stackoverflow.com/questions/10548170/what-characters-are-permitted-fo...
On Wed, Apr 13, 2016 at 12:33 PM, Silent Leaf
wrote: Hi!
say I wanna use "—" as new infix operator: it's the big dash used a bit like parenthesis, especially at the end of sentences —like this.
in ghci directly: Prelude> let (—) a b = a + b
No problem, is accepted and usable. Same in files.
Now I try using (»), a French (amongst others) punctuation sign, typically replaces the quote-ends, « like this ». Doesn't work: <interactive>:2:6: lexical error at character '\187'
I thought Haskell was Unicode-friendly? Why some symbols but not others? :'( _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

Well the problem is, the function you point out returns "true" for both symbols. And yet, one of them is refused as part of an operator, or anywhere for that matter, except between quotes of course. The function isn't true, both symbols are officially Unicode punctuation. That's really weird, and a bit sad, it could have been really useful to me :/

I'm sorry to hear that. I guess the answer is more complicated than I
thought. If I were you I'd post the question on Stack Overflow, there are
quite a few experienced Haskell programmers on there that have always
sorted my issues out quickly and thoroughly. If you do post on Stack
Overflow, please post the link here.
Good luck and sorry my info wasn't helpful.
Tim
On Wed, Apr 13, 2016 at 6:30 PM, Silent Leaf
Well the problem is, the function you point out returns "true" for both symbols. And yet, one of them is refused as part of an operator, or anywhere for that matter, except between quotes of course. The function isn't true, both symbols are officially Unicode punctuation. That's really weird, and a bit sad, it could have been really useful to me :/ _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

I'm sorry to hear that. I guess the answer is more complicated than I
Good idea, that was gonna be my next stop; Will do, thanks for trying to
help me.
Le jeudi 14 avril 2016, Tim Perry
Good luck and sorry my info wasn't helpful. Tim
On Wed, Apr 13, 2016 at 6:30 PM, Silent Leaf
Well the problem is, the function you point out returns "true" for both
symbols. And yet, one of them is refused as part of an operator, or anywhere for that matter, except between quotes of course.
The function isn't true, both symbols are officially Unicode
wrote: punctuation. That's really weird, and a bit sad, it could have been really useful to me :/
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
participants (2)
-
Silent Leaf
-
Tim Perry