Skip to content

do not consider associativity for unary minus for fixity resolution

  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

  1. 6 of http://www.haskell.org/~simonmar/haskell-2010-draft-report-2/haskellch10.html
Trac metadata
Trac field Value
Version 6.12.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information