[commit: ghc] master: Further improvements to well-kinded types (0a12d92)

git at git.haskell.org git at git.haskell.org
Wed Dec 13 16:45:33 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/0a12d92a8f65d374f9317af2759af2b46267ad5c/ghc

>---------------------------------------------------------------

commit 0a12d92a8f65d374f9317af2759af2b46267ad5c
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Dec 13 12:53:26 2017 +0000

    Further improvements to well-kinded types
    
    The typechecker has the invariant that every type should be well-kinded
    as it stands, without zonking.  See Note [The well-kinded type invariant]
    in TcType.
    
    That invariant was not being upheld, which led to Trac #14174.  I fixed
    part of it, but T14174a showed that there was more.  This patch finishes
    the job.
    
    * See Note [The tcType invariant] in TcHsType, which articulates an
      invariant that was very nearly, but not quite, true.  One place that
      falisified it was the HsWildCardTy case of tc_hs_type, so I fixed that.
    
    * mkNakedCastTy now makes no attempt to eliminate casts; indeed it cannot
      lest it break Note [The well-kinded type invariant].  The prior comment
      suggested that it was crucial for performance but happily it seems not
      to be. The extra Refls are eliminated by the zonker.
    
    * I found I could tidy up TcHsType.instantiateTyN and instantiateTyUntilN
      by eliminating one of its parameters.  That led to a cascade of minor
      improvements in TcTyClsDecls. Hooray.


>---------------------------------------------------------------

0a12d92a8f65d374f9317af2759af2b46267ad5c
 compiler/typecheck/TcHsType.hs                     | 144 +++++++++++----------
 compiler/typecheck/TcTyClsDecls.hs                 |  43 +++---
 compiler/typecheck/TcType.hs                       |  49 +++++--
 testsuite/tests/polykinds/T7524.stderr             |   2 +-
 testsuite/tests/polykinds/all.T                    |   2 +-
 .../typecheck/should_fail/T6018failclosed.stderr   |   4 +-
 6 files changed, 138 insertions(+), 106 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 0a12d92a8f65d374f9317af2759af2b46267ad5c


More information about the ghc-commits mailing list