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
-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
-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
-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
*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
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
-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
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
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
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
10 matches
Mail list logo