• Simon Peyton Jones's avatar
    Another refactoring of constraints · d30b9cf4
    Simon Peyton Jones authored
    1. Rejig CtLoc
       * CtLoc is now *not* parameterised (much simpler)
       * CtLoc includes the "depth" of the constraint
       * CtLoc includes the TcLclEnv at the birthplace
         That gives (a) the SrcSpan, (b) the [ErrCtxt]
         (c) the [TcIdBinder]
       * The CtLoc of a constraint is no longer in its CtEvidence
       * Where we passed 'depth' before, now we pass CtLoc
    
    2. Some significant refactoring in TcErrors
       * Get rid of cec_extra
       * Traverse every constraint, so that we can be
         sure to generate bindings where necessary.
         (This was really a lurking bug before.)
    
    3. Merge zonking into TcCanonical.  This turned out to be
       almost trivial; just a small change to TcCanonical.flattenTyVar.
    
       The nice consequence is that we don't need to zonk a constraint
       before solving it; instead it gets zonked "on the fly" as it were.
    d30b9cf4
TcSMonad.lhs 62.7 KB