This last piece of conversation was *so* reminiscent of a paper[1] I once read, I was almost convinced it was late by 11 days...until I checked :)<br><br><br>Cheers,<br><br> Dinko<br><br><br>[1] <a href="http://www.research.att.com/~bs/whitespace98.pdf">
http://www.research.att.com/~bs/whitespace98.pdf</a><br><br><br><div><span class="gmail_quote">On 4/12/07, <b class="gmail_sendername">Simon Marlow</b> <<a href="mailto:simonmarhaskell@gmail.com">simonmarhaskell@gmail.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Isaac Dupree wrote:<br>> -----BEGIN PGP SIGNED MESSAGE-----<br>> Hash: SHA1
<br>><br>> Isaac Dupree wrote:<br>>> Simon Marlow wrote:<br>>>>> I definitely think that -1# should be parsed as a single lexeme.<br>>>>> Presumably it was easier at the time to do it the way it is, I don't
<br>>>>> remember exactly.<br>>>>><br>>>>> I'd support a warning for use of prefix negation, or alternatively you<br>>>>> could implement the Haskell' proposal to remove prefix negation
<br>>>>> completely - treat the unary minus as part of a numeric literal in the<br>>>>> lexer only. This would have to be optional for now, so that we can<br>>>>> continue to support Haskell 98 of course.
<br>>>>><br>>>>> Cheers,<br>>>>> Simon<br>>> Yes, I've been thinking about how to implement both - details will come<br>>> later when I have more time. I think I have a reasonably working idea
<br>>> of how to divide up the cases for warnings for ambiguous-looking use of<br>>> both infix and prefix minus, as well as actual syntax changes...<br>><br>> not considering warnings, just syntax: 123abc is two valid Haskell
<br>> tokens. for example:<br>> \begin{code}<br>> main = (\n c -> print (n,c)) 123Abc<br>> data Abc = Abc deriving Show<br>> \end{code}<br>> prints (123,Abc).<br>> So does this suggest that under a negation-is-part-of-numeric-token
<br>> regime, 123-456 should be two tokens (a positive number then a negative<br>> number, here), as is signum-456 ...<br><br>Yes, absolutely.<br><br> > Presently, GHC doesn't even warn about the first thing (123abc) ^_^
<br><br>and remember that while '123e 4' is 3 tokens, '123e4' is only 1.<br><br>Cheers,<br> Simon<br>_______________________________________________<br>Glasgow-haskell-users mailing list<br><a href="mailto:Glasgow-haskell-users@haskell.org">
Glasgow-haskell-users@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br></blockquote></div><br><br clear="all">
<br>-- <br><br>Cheers,<br> Dinko<br>