• Oleg Grenrus's avatar
    Disallow wildcards and operators when spec is old · 2afbd0e1
    Oleg Grenrus authored
    Do this already in the Parsec instance parser.
    This allows removing checks from `D.PD.Check`.
    Later this would also allow removing non-relevant
    constructors from `VersionRange`, allowing easier testing.
    
    This change causes 10% slowdown: from
    
    ```
    135768 files processed
      7350 files contained warnings
    113156 files have check warnings
         0 files failed to parse
    
    120.901201s elapsed
    117.640431s elapsed
    119.663620s elapsed
    119.454329s elapsed
    119.785214s elapsed
    ```
    
    to
    
    ```
    135768 files processed
     31912 files contained warnings
    113109 files have check warnings
         0 files failed to parse
    
    130.969593s elapsed
    132.016403s elapsed
    134.214536s elapsed
    128.753382s elapsed
    131.503804s elapsed
    ```
    
    I hope the slowdown is acceptable, and I have an idea which may mitigate
    this. I'll try out it after I done further refactorings.
    
    Note how (parser) warnings grew by a factor. There are plenty of (old)
    files on Hackage, which don't use correct cabal-version.  For that
    reason we only issue warnings, and not fail.  Quirks approach won't
    scale for these. In comparison, there are even more files
    with check warnings
    2afbd0e1
Check.hs 92.7 KB