1. 20 Oct, 2017 2 commits
    • Simon Peyton Jones's avatar
      Improve kick-out in the constraint solver · 3acd6164
      Simon Peyton Jones authored
      This patch was provoked by Trac #14363.  Turned out that we were
      kicking out too many constraints in TcSMonad.kickOutRewritable, and
      that mean that the work-list never became empty: infinite loop!
      
      That in turn made me look harder at the Main Theorem in
      Note [Extending the inert equalities].
      
      Main changes
      
      * Replace TcType.isTyVarExposed by TcType.isTyVarHead.  The
        over-agressive isTyVarExposed is what caused Trac #14363.
        See Note [K3: completeness of solving] in TcSMonad.
      
      * TcType.Make anyRewriteableTyVar role-aware.  In particular,
            a ~R ty
        cannot rewrite
            b ~R f a
        See Note [anyRewriteableTyVar must be role-aware].  That means
        it has to be given a role argument, which forces a little
        refactoring.
      
        I think this change is fixing a bug that hasn't yet been reported.
        The actual reported bug is handled by the previous bullet.  But
        this change is definitely the Right Thing
      
      The main changes are in TcSMonad.kick_out_rewritable, and in TcType
      (isTyVarExposed ---> isTyVarHead).
      
      I did a little unforced refactoring:
      
       * Use the cc_eq_rel field of a CTyEqCan when it is available, rather
         than recomputing it.
      
       * Define eqCanRewrite :: EqRel -> EqRel -> EqRel, and use it, instead
         of duplicating its logic
      3acd6164
    • Simon Peyton Jones's avatar
      Comments and white space · c1efc6e6
      Simon Peyton Jones authored
      c1efc6e6
  2. 19 Oct, 2017 13 commits
  3. 18 Oct, 2017 4 commits
    • Gabor Greif's avatar
      whitespace only · 870020e6
      Gabor Greif authored
      870020e6
    • Gabor Greif's avatar
      Typofix in comment · aba77860
      Gabor Greif authored
      aba77860
    • Simon Peyton Jones's avatar
      Better solving for representational equalities · 5a66d574
      Simon Peyton Jones authored
      This patch adds a bit of extra solving power for representational
      equality constraints to fix Trac #14333
      
      The main changes:
      
      * Fix a buglet in TcType.isInsolubleOccursCheck which wrongly
        reported a definite occurs-check error for (a ~R# b a)
      
      * Get rid of TcSMonad.emitInsolubles.  It had an ad-hoc duplicate-removal
        piece that is better handled in interactIrred, now that insolubles
        are Irreds.
      
        We need a little care to keep inert_count (which does not include
        insolubles) accurate.
      
      * Refactor TcInteract.solveOneFromTheOther, to return a much simpler
        type.  It was just over-complicated before.
      
      * Make TcInteract.interactIrred look for constraints that match
        either way around, in TcInteract.findMatchingIrreds
      
      This wasn't hard and it cleaned up quite a bit of code.
      5a66d574
    • Simon Peyton Jones's avatar
      Don't deeply expand insolubles · 74cd1be0
      Simon Peyton Jones authored
      Trac #13450 went bananas if we expand insoluble constraints.
      Better just to leave them un-expanded.
      
      I'm not sure in detail about why it goes so badly wrong; but
      regardless, the less we mess around with insoluble contraints
      the better the error messages will be.
      74cd1be0
  4. 17 Oct, 2017 3 commits
    • Joachim Breitner's avatar
      Improve user’s guide around deriving · 317aa966
      Joachim Breitner authored
      In particular:
       * add an intro to “10.6. Extensions to the “deriving” mechanism” giving
         an overview,
       * make the various sections on `-XDerivingFoo` subsections of
         “10.6.3. Deriving instances of extra classes (Data, etc.)”
       * Move the reference anchors for the various `DerivingFoo` extensions
         to a more appropriate spot.
       * Add subsection “10.6.6.1. Default deriving strategy” to the
         deriving section (#14357)
      317aa966
    • Gabor Greif's avatar
      Fix grammaros in comments · 2f436151
      Gabor Greif authored
      2f436151
    • Gabor Greif's avatar
      Simplify, no functionality change · ed48d133
      Gabor Greif authored
      ed48d133
  5. 16 Oct, 2017 18 commits