[commit: ghc] ghc-8.6: Treat isConstraintKind more consistently (6a7cb80)

git at git.haskell.org git at git.haskell.org
Thu Aug 2 02:42:47 UTC 2018


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

On branch  : ghc-8.6
Link       : http://ghc.haskell.org/trac/ghc/changeset/6a7cb80648253ebcc84be5f11e2cc78eae085aa8/ghc

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

commit 6a7cb80648253ebcc84be5f11e2cc78eae085aa8
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.
    
    (cherry picked from commit c5d31df70b16dc346b5860077c8bbe585ddb7a78)


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

6a7cb80648253ebcc84be5f11e2cc78eae085aa8
 compiler/typecheck/TcErrors.hs                     |   6 +-
 compiler/typecheck/TcHsType.hs                     |   9 +-
 compiler/typecheck/TcInstDcls.hs                   |   1 -
 compiler/typecheck/TcInteract.hs                   |   3 +-
 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 6a7cb80648253ebcc84be5f11e2cc78eae085aa8


More information about the ghc-commits mailing list