Newbie proposal: operator backquoting

David House dmhouse at gmail.com
Mon Jun 25 16:54:51 EDT 2007


Dusty writes:
 > I propose to use the same construct, that always used to convert function
 > application to binary operator: backquoting. Any lexeme, bounded by
 > backquotes, will be treated by grammar as binary operator; and no special
 > grammatic case can be applied.

Presumably it wouldn't be _required_ to backquote operators. So the only time
you'd be thinking of using backquotes is when you have some expression which is
parsing weirdly, and you want to make it clearer. But then rather than using
backquotes, as you propose, you could just disambiguate it in a different way
that already exiss.

For example, suppose you make the classic mistake of trying to use (.) with a
constructor without putting sufficient space in:

  foo = Just.negate

And this parses as the identifier 'negate' from the module Just. So under your
proposal you could write this as:

  foo = Just`.`negate

But equally one could just put spaces in:

  foo = Just . negate

This is always possible. Therefore I don't see the value of your proposal,
unless people get into the habit of using backquotes all the time, and thereby
avoiding things like Just.negate from ever coming up in the first place. But I
think this is unlikely.

-- 
-David House, dmhouse at gmail.com


More information about the Haskell-prime mailing list