Changes between Version 8 and Version 9 of PrefixMinusResolution


Ignore:
Timestamp:
Jul 14, 2010 8:11:28 AM (4 years ago)
Author:
maeder
Comment:

reformulated point 3 and report delta

Legend:

Unmodified
Added
Removed
Modified
  • PrefixMinusResolution

    v8 v9  
    1515Resolve more prefix minus application unambiguously by: 
    1616 
    17 1. Considering only operators to the right of prefix negation. 
     171. Considering only operators to the right of prefix negation (as currently done only by Hugs) 
    1818 
    19 2. Leave prefix minus bind less tight than multiplication. 
     192. Leave prefix minus bind less tight than multiplication (as is currently done) 
    2020 
    21 3. Do not consider associativity of prefix minus or (alternative formulation) let prefix minus bind a bit stronger than infix minus. 
     213. one of the following alternative formulations (the essence of this propoasl) 
     22 
     23   - Do not consider associativity of prefix minus  
     24   - Let prefix minus bind a bit stronger than infix minus 
     25   - Resolve ''all'' prefix minus applications (prior to infix resolution) 
     26    
    2227 
    2328Pro:  
     
    98103with: 
    99104"The handling of the prefix negation operator, -, complicates matters only slightly. (Recall that) prefix negation has lower precedence than infix multiplication. So -a * b resolves as -(a * b) or more importantly `-a ^ b` as `-(a ^ b)`. Generally, prefix negation extends as long to the right as there are consecutive infix operators with precedences at least as high as multiplication. 
    100 The operator to the left of prefix -, if there is one, is ignored. So a + -b or a * -b are legal. Prefix negation binds tighter with infix operators to the right of lower precedence than multiplication. So for example -a + b is legal and resolves as (-a) + b." 
     105The operator to the left of prefix -, if there is one, is irrelevant for resolution. So a + -b or a * -b are legal. Prefix negation binds tighter with infix operators to the right of lower precedence than multiplication. So for example -a + b is legal and resolves as (-a) + b." 
    101106 
    102107(Use the algorithm from http://hackage.haskell.org/trac/ghc/ticket/4180)