This last piece of conversation was *so* reminiscent of a paper[1] I once read,&nbsp; I was almost convinced it was late by 11 days...until I checked :)<br><br><br>Cheers,<br><br>&nbsp;&nbsp;&nbsp; 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> &lt;<a href="mailto:simonmarhaskell@gmail.com">simonmarhaskell@gmail.com
</a>&gt; 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>&gt; -----BEGIN PGP SIGNED MESSAGE-----<br>&gt; Hash: SHA1
<br>&gt;<br>&gt; Isaac Dupree wrote:<br>&gt;&gt; Simon Marlow wrote:<br>&gt;&gt;&gt;&gt; I definitely think that -1# should be parsed as a single lexeme.<br>&gt;&gt;&gt;&gt; Presumably it was easier at the time to do it the way it is, I don&#39;t
<br>&gt;&gt;&gt;&gt; remember exactly.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; I&#39;d support a warning for use of prefix negation, or alternatively you<br>&gt;&gt;&gt;&gt; could implement the Haskell&#39; proposal to remove prefix negation
<br>&gt;&gt;&gt;&gt; completely - treat the unary minus as part of a numeric literal in the<br>&gt;&gt;&gt;&gt; lexer only.&nbsp;&nbsp;This would have to be optional for now, so that we can<br>&gt;&gt;&gt;&gt; continue to support Haskell 98 of course.
<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Cheers,<br>&gt;&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; Simon<br>&gt;&gt; Yes, I&#39;ve been thinking about how to implement both - details will come<br>&gt;&gt; later when I have more time.&nbsp;&nbsp;I think I have a reasonably working idea
<br>&gt;&gt; of how to divide up the cases for warnings for ambiguous-looking use of<br>&gt;&gt; both infix and prefix minus, as well as actual syntax changes...<br>&gt;<br>&gt; not considering warnings, just syntax:&nbsp;&nbsp;123abc is two valid Haskell
<br>&gt; tokens. for example:<br>&gt; \begin{code}<br>&gt; main = (\n c -&gt; print (n,c)) 123Abc<br>&gt; data Abc = Abc deriving Show<br>&gt; \end{code}<br>&gt; prints (123,Abc).<br>&gt; So does this suggest that under a negation-is-part-of-numeric-token
<br>&gt; regime, 123-456 should be two tokens (a positive number then a negative<br>&gt; number, here), as is signum-456 ...<br><br>Yes, absolutely.<br><br> &gt; Presently, GHC doesn&#39;t even warn about the first thing (123abc) ^_^
<br><br>and remember that while &#39;123e 4&#39; is 3 tokens, &#39;123e4&#39; is only 1.<br><br>Cheers,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;&nbsp;&nbsp;&nbsp;Dinko<br>