#4180: do not consider associativity for unary minus for fixity resolution
----------------------------------+-----------------------------------------
    Reporter:  maeder             |        Owner:              
        Type:  proposal           |       Status:  new         
    Priority:  normal             |    Milestone:              
   Component:  Compiler           |      Version:  6.12.3      
    Keywords:  fixity resolution  |   Difficulty:              
          Os:  Unknown/Multiple   |     Testcase:              
Architecture:  Unknown/Multiple   |      Failure:  None/Unknown
----------------------------------+-----------------------------------------

Comment(by maeder):

 also see http://hackage.haskell.org/trac/haskell-
 prime/wiki/PrefixMinusResolution (as positive answer to b)

 The "simple mental model" is: "prefix minus applications extend as far to
 the right as long as infix operators have higher precedence." (This
 happens in my recent Resolve.hs attachment by `resolveNegExpr`.) Therefore
 "- 1 ## 1" should resolve as "(- 1) ## 1", too.

 Both attached versions (Fixity.hs and Resolve.hs) resolve identically (and
 identically to Simon's version http://darcs.haskell.org/haskell-
 prime/fixity/resolve.hs, if "guard (prec1 < 6)" is omitted and the
 constructed precedence for unary minus is increased to 6.5 in "parseNeg
 (Op "-" 6 Leftfix) rest", which also requires to change "type Prec = Int"
 to Float.)

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4180#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to