[commit: ghc] ghc-8.6: Refactor the kind-checking of tyvar binders (7e19610)

git at git.haskell.org git at git.haskell.org
Wed Jun 27 21:09:32 UTC 2018

Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.6
Link       : http://ghc.haskell.org/trac/ghc/changeset/7e19610c925c45ade589b573a7e1c247cd8265ef/ghc


commit 7e19610c925c45ade589b573a7e1c247cd8265ef
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Jun 25 13:20:59 2018 +0100

    Refactor the kind-checking of tyvar binders
    The refactoring here is driven by the ghastly mess described in
    comment:24 of Trac #1520.  The overall goal is to simplify the
    kind-checking of typev-variable binders, and in particular to narrow
    the use of the "in-scope tyvar binder" stuff,
    which is needed only for associated types: see the new
    Note [Kind-checking tyvar binders for associated types] in TcHsType.
    * The "in-scope tyvar binder" stuff is done only in
         - kcLHsQTyVars, which is used for the LHsQTyVars of a
           data/newtype, or type family declaration.
         - tcFamTyPats, which is used for associated family instances;
           it now calls tcImplicitQTKBndrs, which in turn usese
    * tcExpicitTKBndrs (which is used only for function signatures,
      data con signatures, pattern synonym signatures, and expression
      type signatures) now does not go via the "in-scope tyvar binder"
      stuff at all.
    While I'm still not happy with all this code, the code is generally
    simpler, and I think this is a useful step forward. It does cure
    the problem too.
    (It's hard to trigger the problem in vanilla Haskell code, because
    the renamer would normally use different names for nested binders,
    so I can't offer a test.)
    (cherry picked from commit 9fc40c733ba8822a04bd92883801b214dee099ca)


 compiler/hsSyn/HsDecls.hs          |  43 +++++--
 compiler/typecheck/TcHsType.hs     | 258 +++++++++++++++++++++----------------
 compiler/typecheck/TcTyClsDecls.hs |   3 +-
 3 files changed, 178 insertions(+), 126 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 7e19610c925c45ade589b573a7e1c247cd8265ef

More information about the ghc-commits mailing list