1. 21 Mar, 2020 2 commits
    • Richard Eisenberg's avatar
      Update core spec to reflect changes to Core. · 9a96ff6b
      Richard Eisenberg authored
      Key changes:
       * Adds a new rule for forall-coercions over coercion variables, which
      was implemented but conspicuously missing from the spec.
       * Adds treatment for FunCo.
       * Adds treatment for ForAllTy over coercion variables.
       * Improves commentary (including restoring a Note lost in
      03d48526) in the source.
      
      No changes to running code.
      9a96ff6b
    • Richard Eisenberg's avatar
      Simplify treatment of heterogeneous equality · 73a7383e
      Richard Eisenberg authored
      Previously, if we had a [W] (a :: k1) ~ (rhs :: k2), we would
      spit out a [D] k1 ~ k2 and part the W as irreducible, hoping for
      a unification. But we needn't do this. Instead, we now spit out
      a [W] co :: k2 ~ k1 and then use co to cast the rhs of the original
      Wanted. This means that we retain the connection between the
      spat-out constraint and the original.
      
      The problem with this new approach is that we cannot use the
      casted equality for substitution; it's too like wanteds-rewriting-
      wanteds. So, we forbid CTyEqCans that mention coercion holes.
      
      All the details are in Note [Equalities with incompatible kinds]
      in TcCanonical.
      
      There are a few knock-on effects, documented where they occur.
      
      While debugging an error in this patch, Simon and I ran into
      infelicities in how patterns and matches are printed; we made
      small improvements.
      
      This patch includes mitigations for #17828, which causes spurious
      pattern-match warnings. When #17828 is fixed, these lines should
      be removed.
      73a7383e
  2. 18 Mar, 2020 1 commit
  3. 17 Mar, 2020 3 commits
    • Richard Eisenberg's avatar
      Fix #17021 by checking more return kinds · 53ff2cd0
      Richard Eisenberg authored
      All the details are in new Note [Datatype return kinds] in
      TcTyClsDecls.
      
      Test case: typecheck/should_fail/T17021{,b}
                 typecheck/should_compile/T17021a
      
      Updates haddock submodule
      53ff2cd0
    • Simon Peyton Jones's avatar
      Implement mapTyCo like foldTyCo · beffa147
      Simon Peyton Jones authored
      This patch makes mapType use the successful idiom described
      in TyCoRep
         Note [Specialising foldType]
      
      I have not yet changed any functions to use mapType, though there
      may be some suitable candidates.
      
      This patch should be a no-op in terms of functionality but,
      because it inlines the mapper itself, I'm hoping that there may
      be some modest perf improvements.
      
      Metric Decrease:
          T5631
          T5642
          T3064
          T9020
          T14683
          hie002
          haddock.Cabal
          haddock.base
          haddock.compiler
      beffa147
    • Sylvain Henry's avatar
      Modules: Core (#13009) · 18a346a4
      Sylvain Henry authored
      Update submodule: haddock
      18a346a4
  4. 15 Mar, 2020 1 commit
  5. 14 Mar, 2020 3 commits
    • Simon Peyton Jones's avatar
      Improve CSE.combineAlts · 88f7a762
      Simon Peyton Jones authored
      This patch improves the way that CSE combines identical
      alternatives.  See #17901.
      
      I'm still not happy about the duplication between CSE.combineAlts
      and GHC.Core.Utils.combineIdenticalAlts; see the Notes with those
      functions.  But this patch is a step forward.
      
      Metric Decrease:
          T12425
          T5642
      88f7a762
    • Simon Peyton Jones's avatar
      Simple refactor of cheapEqExpr · 2f8c7767
      Simon Peyton Jones authored
      No change in functionality.  Just seems tidier (and signficantly more
      efficient) to deal with ticks directly than to call stripTicksTopE.
      2f8c7767
    • Simon Peyton Jones's avatar
      Fix Lint · c12a2ec5
      Simon Peyton Jones authored
      Ticket #17590 pointed out a bug in the way the linter dealt with
      type lets, exposed by the new uniqAway story.
      
      The fix is described in Note [Linting type lets]. I ended up
      putting the in-scope Ids in a different env field, le_ids,
      rather than (as before) sneaking them into the TCvSubst.
      
      Surprisingly tiresome, but done.
      
      Metric Decrease:
          hie002
      c12a2ec5
  6. 11 Mar, 2020 1 commit
    • Sylvain Henry's avatar
      Split GHC.Iface.Utils module · 20800b9a
      Sylvain Henry authored
      * GHC.Iface.Recomp: recompilation avoidance stuff
      * GHC.Iface.Make: mkIface*
      
      Moved `writeIfaceFile` into GHC.Iface.Load alongside `readIface` and
      renamed it `writeIface` for consistency.
      20800b9a
  7. 10 Mar, 2020 2 commits
    • Krzysztof Gogolewski's avatar
      Typos in comments [skip ci] · abf5736b
      Krzysztof Gogolewski authored
      abf5736b
    • Ben Price's avatar
      Clarify a Lint message · 5ba01d83
      Ben Price authored
      When developing a plugin I had a shadowing problem, where I generated
      code
        app = \f{v r7B} x{v r7B} -> f{v r7B} x{v r7B}
      This is obviously wrong, since the occurrence of `f` to the right of the
      arrow refers to the `x` binder (they share a Unique). However, it is
      rather confusing when Lint reports
        Mismatch in type between binder and occurrence
        Var: x{v rB7}
      since it is printing the binder, rather than the occurrence.
      It is rather easy to read this as claiming there is something wrong with
      the `x` occurrence!
      
      We change the report to explicitly print both the binder and the
      occurrence variables.
      5ba01d83
  8. 26 Feb, 2020 1 commit