unicode characters in operator name

Greg greglists at me.com
Fri Sep 10 21:12:11 EDT 2010


I'm creating a family of methods for a class, and to prevent name clashes I've annotated the function names with º.  The files are saved UTF-8, so the character is accepted.

Method names of the form fº are handled fine.  GHC consumes them quite happily.  Where I'm having trouble is in operator names.  I'd like to create the operator (*º) but I get a type error: Invalid type signature for this line:

(*º) :: (Real b, Floating b) => b -> a -> a

I've tried other (ascii) symbol combinations and they're accepted, so I think the general form of my type declaration is fine.

If I read the Haskell Report correctly, operators are named by (symbol {symbol | : }), where symbol is either an ascii symbol (including *) or a unicode symbol (defined as any Unicode symbol or punctuation).  I'm pretty sure º is a unicode symbol or punctuation.

I know I could get around this by using a different name, but this naming convention is more intuitive for what I'm trying to do.  Am I misinterpreting the report, or am I doing something else wrong?


-------------- next part --------------
Skipped content of type multipart/related

More information about the Glasgow-haskell-users mailing list