On 07/07/10 16:56, Christian Maeder wrote:
Simon Marlow schrieb:
prefix negation should move to lexp to
be consistent with lpat
prefix negation should not move to lexp, because this would rule out
"- 1 ^ 2" as negated infix expression "- (1 ^ 2)",
It wouldn't - remember the grammar just parses infix expressions as a
list, they get rearranged by fixity resolution.
I'm arguing that the current grammar is halfway between two consistent
positions: one in which prefix negation is lexp, the other is your
proposal to make the grammar ambiguous. So we should do one or the other.
whereas a negated
infix pattern is impossible. Unary minus is no constructor and cannot be
defined. The latter should be (or is already?) mentioned somewhere.
You could move prefix negation to lexp, if you allow the fixity
resolution to construct negated infix expression that are not covered by
the grammar (as currently happens anyway).
Right, that's what I'm saying. No change needed to fixity resolution,
just move prefix negation into lexp.
Moving prefix negation from lpat to pat to be consistent with infixexp
would be overkill, though.
Yes.
Cheers,
Simon
_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime