Re: Wanted: warning option for usages of unary minus

2007-05-21 Thread John Meacham
On Mon, May 21, 2007 at 10:33:56AM +0100, Simon Marlow wrote: I think that we could easily remove the '3e4' lexical syntax though, since '3*10^^4' works just as well (I often write the latter anyway) (and guess what, I just had to look up the difference between ^ and ^^, only to discover I

Re: Wanted: warning option for usages of unary minus

2007-05-19 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John Meacham wrote: another option would be to only count it as a negative if there is a non-identifier character preceeding it. A little ugly. but still better than the current situation IMHO. I think Ghc's lexer Alex can do this although this

Re: Wanted: warning option for usages of unary minus

2007-05-18 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Taral wrote: On 5/17/07, Joseph H. Fasel [EMAIL PROTECTED] wrote: *Sigh* The problems with unary minus were discussed in the dim mists of time before we published the first Haskell report. We considered then using a separate symbol for unary

Re: Wanted: warning option for usages of unary minus

2007-05-17 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Iavor Diatchki wrote: Hello, I agree with Simon on this one: x-1 should parse as expected (i.e., the infix operator - applied to two arguments x and 1). Having this result in a type error would be confusing to both beginners and working Haskell

Re: Wanted: warning option for usages of unary minus

2007-05-17 Thread Joseph H. Fasel
*Sigh* The problems with unary minus were discussed in the dim mists of time before we published the first Haskell report. We considered then using a separate symbol for unary negation (as does APL, for example), but (IIRC) this was regarded as unfriendly to Fortran programmers. Cheers, --Joe

Re: Wanted: warning option for usages of unary minus

2007-05-17 Thread Twan van Laarhoven
Simon Marlow wrote: ... Really? I'm beginning to have second thoughts about the proposed change to negation for Haskell'. The main reason, and this isn't pointed out as well as it should be on the wiki, is that x-1 will cease to be an infix application of (-), it will parse as x applied to

Re: Wanted: warning option for usages of unary minus

2007-05-17 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Twan van Laarhoven wrote: There is one other alternative for parsing: - is a unary minus if and only if it is a) preceded by whitespace or one of [({;,, and b) not followed by whitespace. So: x - 1 ==(-) x 1 x-1

Re: Wanted: warning option for usages of unary minus

2007-05-17 Thread Taral
On 5/17/07, Joseph H. Fasel [EMAIL PROTECTED] wrote: *Sigh* The problems with unary minus were discussed in the dim mists of time before we published the first Haskell report. We considered then using a separate symbol for unary negation (as does APL, for example), but (IIRC) this was regarded

Re: Wanted: warning option for usages of unary minus

2007-05-14 Thread Simon Marlow
John Meacham wrote: On Wed, Apr 11, 2007 at 09:05:21AM +0100, Simon Marlow wrote: I definitely think that -1# should be parsed as a single lexeme. Presumably it was easier at the time to do it the way it is, I don't remember exactly. I'd support a warning for use of prefix negation, or

Re: Wanted: warning option for usages of unary minus

2007-05-14 Thread Iavor Diatchki
Hello, I agree with Simon on this one: x-1 should parse as expected (i.e., the infix operator - applied to two arguments x and 1). Having this result in a type error would be confusing to both beginners and working Haskell programmers. I think that if we want to change anything at all, we