[commit: ghc] master: Treat isConstraintKind more consistently (c5d31df)

git at git.haskell.org git at git.haskell.org
Wed Jul 25 11:26:04 UTC 2018


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

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

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

commit c5d31df70b16dc346b5860077c8bbe585ddb7a78
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Jul 25 11:35:43 2018 +0100

    Treat isConstraintKind more consistently
    
    It turned out that we were not being consistent
    about our use of isConstraintKind.
    
    It's delicate, because the typechecker treats Constraint and Type as
    /distinct/, whereas they are the /same/ in the rest of the compiler
    (Trac #11715).
    
    And had it wrong, which led to Trac #15412.  This patch does the
    following:
    
    * Rename isConstraintKind      to tcIsConstraintKind
             returnsConstraintKind to tcReturnsConstraintKind
      to emphasise that they use the 'tcView' view of types.
    
    * Move these functions, and some related ones (tcIsLiftedTypeKind),
      from Kind.hs, to group together in Type.hs, alongside isPredTy.
    
    It feels very unsatisfactory that these 'tcX' functions live in Type,
    but it happens because isPredTy is called later in the compiler
    too.  But it's a consequence of the 'Constraint vs Type' dilemma.


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

c5d31df70b16dc346b5860077c8bbe585ddb7a78
 compiler/typecheck/ClsInst.hs                      |   3 +-
 compiler/typecheck/TcErrors.hs                     |   6 +-
 compiler/typecheck/TcHsType.hs                     |   9 +-
 compiler/typecheck/TcInstDcls.hs                   |   1 -
 compiler/typecheck/TcMType.hs                      |   5 +-
 compiler/typecheck/TcSplice.hs                     |   1 -
 compiler/typecheck/TcTyClsDecls.hs                 |   4 +-
 compiler/typecheck/TcType.hs                       |  69 ++++++------
 compiler/typecheck/TcValidity.hs                   |   8 +-
 compiler/types/Kind.hs                             |  31 +----
 compiler/types/TyCoRep.hs                          |  22 +---
 compiler/types/Type.hs                             | 125 ++++++++++++++-------
 compiler/types/Unify.hs                            |   1 -
 testsuite/tests/rename/should_fail/T5513.stderr    |   2 +-
 testsuite/tests/typecheck/should_compile/T15412.hs |  17 +++
 testsuite/tests/typecheck/should_compile/all.T     |   1 +
 16 files changed, 156 insertions(+), 149 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 c5d31df70b16dc346b5860077c8bbe585ddb7a78


More information about the ghc-commits mailing list