[Haskell-beginners] Unicode characters in function names: some don't work?

Tim Perry tim.v2.0 at gmail.com
Thu Apr 14 00:02:36 UTC 2016


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:isPunctuation

On Wed, Apr 13, 2016 at 4:50 PM, Tim Perry <tim.v2.0 at gmail.com> wrote:

> 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-for-haskell-operators
>
>
> On Wed, Apr 13, 2016 at 12:33 PM, Silent Leaf <silent.leaf0 at gmail.com>
> 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 at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160413/695cf951/attachment.html>


More information about the Beginners mailing list