Iavor Diatchki wrote:
Hello,
Is there a reason why we have to escape the character ' (apostrophe)
when used in a character literal?  For example, we have to write '\''
instead of '''.  (With syntax highlighting, the second is a lot better
looking than the first.)  It seems that in this case we do not need
the escape because a literal contains exactly one character.  If there
is no good reason for having the scape, I think that we should remove
this restriction in Haskell'.
-Iavor

If you really want you can also allow an unescapped backslash, '\'. The rules for parsing character literals would become something like:
 case input of
  '''   -> a single quote
  '\''  -> a single quote
  '\'   -> a backslash
  '\..' -> an escape
  'a'   -> a normal character

I'm not saying this is a good idea, just that it is possible. :)

Twan
_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime

Reply via email to