Ticket #4180 (new feature request)
do not consider associativity for unary minus for fixity resolution
| Reported by: | maeder | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 7.6.2 |
| Component: | Compiler (Parser) | Version: | 6.12.3 |
| Keywords: | fixity resolution | Cc: | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
1. currently an expression "1 + - 1" is rejected, because "1 + (-1)" looks as being bracketed to the right, whereas + and - are left associative. However, no other bracketing is possible, so "1 + - 1" is unambiguous and should not be subject to further fixity resolution.
2. if an infix expressions starts with an unary minus, the associativity should not matter for the unary minus. Why should "- 1 ## 1" be rejected for a right- or non-assoc operator "##"? Precedence alone is sufficient to decide between "(- 1) ## 1" and "- (1 ## 1)". The latter choice is taken for a higher precedence of the infix operator and the former choice should always be taken for an equal or lower precedence as is done for "- 1 + 1", but without looking at associativity!
I'll attach an alternative fixity resolution in the spirit of 10.6 of http://www.haskell.org/~simonmar/haskell-2010-draft-report-2/haskellch10.html

