[commit: ghc] master: Introduce tcTypeKind, and use it (03d4852)

git at git.haskell.org git at git.haskell.org
Mon Dec 3 13:42:58 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/03d4852658e1b7407abb4da84b1b03bfa6f6db3b/ghc

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

commit 03d4852658e1b7407abb4da84b1b03bfa6f6db3b
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Dec 3 11:30:22 2018 +0000

    Introduce tcTypeKind, and use it
    
    In the type checker Constraint and * are distinct; and the function
    that takes the kind of a type should respect that distinction
    (Trac #15971).
    
    This patch implements the change:
    
    * Introduce Type.tcTypeKind, and use it throughout the type
      inference engine
    
    * Add new Note [Kinding rules for types] for the kinding
      rules, especially for foralls.
    
    * Redefine
        isPredTy ty = tcIsConstraintKind (tcTypeKind ty)
      (it had a much more complicated definition before)
    
    Some miscellaneous refactoring
    
    * Get rid of TyCoRep.isTYPE, Kind.isTYPEApp,
      in favour of TyCoRep.kindRep, kindRep_maybe
    
    * Rename Type.getRuntimeRepFromKind_maybe
      to getRuntimeRep_maybe
    
    I did some spot-checks on compiler perf, and it really doesn't
    budge (as expected).


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

03d4852658e1b7407abb4da84b1b03bfa6f6db3b
 compiler/typecheck/ClsInst.hs      |   4 +-
 compiler/typecheck/FamInst.hs      |   4 +-
 compiler/typecheck/Inst.hs         |   8 +-
 compiler/typecheck/TcCanonical.hs  |  16 +--
 compiler/typecheck/TcDeriv.hs      |  10 +-
 compiler/typecheck/TcDerivInfer.hs |   6 +-
 compiler/typecheck/TcErrors.hs     |  33 ++---
 compiler/typecheck/TcExpr.hs       |   4 +-
 compiler/typecheck/TcFlatten.hs    |  38 ++---
 compiler/typecheck/TcHsSyn.hs      |   2 +-
 compiler/typecheck/TcHsType.hs     |  18 +--
 compiler/typecheck/TcInteract.hs   |   4 +-
 compiler/typecheck/TcMType.hs      |  10 +-
 compiler/typecheck/TcPat.hs        |   2 +-
 compiler/typecheck/TcPatSyn.hs     |   4 +-
 compiler/typecheck/TcRnDriver.hs   |   2 +-
 compiler/typecheck/TcRnTypes.hs    |   4 +-
 compiler/typecheck/TcSimplify.hs   |   4 +-
 compiler/typecheck/TcSplice.hs     |   6 +-
 compiler/typecheck/TcTyClsDecls.hs |   8 +-
 compiler/typecheck/TcType.hs       |  22 +--
 compiler/typecheck/TcTypeable.hs   |  17 ++-
 compiler/typecheck/TcUnify.hs      |  12 +-
 compiler/typecheck/TcValidity.hs   |   8 +-
 compiler/types/Kind.hs             |  24 +---
 compiler/types/TyCoRep.hs          |  73 ++++++----
 compiler/types/Type.hs             | 274 +++++++++++++++++--------------------
 27 files changed, 304 insertions(+), 313 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 03d4852658e1b7407abb4da84b1b03bfa6f6db3b


More information about the ghc-commits mailing list