[Haskell-cafe] Re: Where does ~> come from?

Ben Franksen ben.franksen at online.de
Wed Feb 20 19:53:20 EST 2008


Stefan O'Rear wrote:
> On Wed, Feb 20, 2008 at 07:18:42PM -0500, Steve Lihn wrote:
>> If ~> does not have any special meaning and it could be ### or xyz,
>> then how does GHC know to print
>>  a ~> b, but not ~> a b
>>  a ### b, but not ### a b
>>  xyz a b, but not a `xyz` b
>> 
>> Simply because xyz is alphanumeric?
> 
> Yes.

To slightly elaborate this: In Haskell, normal (prefix) functions and
operators (infix) functions are syntactically distinguished by the
characters they may contain: the former must contain only alphanumerics
plus ' and _, the latter only operator symbols such as !#$%&*+./<=>?@\^|-~
for details see the Haskell98 Report
(http://www.haskell.org/onlinelibrary/lexemes.html).

Cheers
Ben



More information about the Haskell-Cafe mailing list