[commit: ghc] master: Clean up coreView/tcView. (6575f4b)

git at git.haskell.org git at git.haskell.org
Fri Mar 31 22:18:30 UTC 2017


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

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

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

commit 6575f4b635a393775295798ca86c7c3ba00819be
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Mon Mar 27 13:17:00 2017 -0400

    Clean up coreView/tcView.
    
    In Core, Constraint should be considered fully equal to
    TYPE LiftedRep, in all ways. Accordingly, coreView should
    unwrap Constraint to become TYPE LiftedRep. Of course, this
    would be a disaster in the type checker.
    
    So, where previously we used coreView in both the type checker
    and in Core, we now have coreView and tcView, which differ only
    in their treatment of Constraint.
    
    Historical note: once upon a past, we had tcView distinct from
    coreView. Back then, it was because newtypes were unwrapped in
    Core but not in the type checker. The distinction is back, but
    for a different reason than before.
    
    This had a few knock-on effects:
    
     * The Typeable solver must explicitly handle Constraint to ensure
       that we produce the correct evidence.
    
     * TypeMap now respects the Constraint/Type distinction
    
    Finished by: bgamari
    
    Test Plan: ./validate
    
    Reviewers: simonpj, austin, bgamari
    
    Reviewed By: simonpj
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3316


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

6575f4b635a393775295798ca86c7c3ba00819be
 compiler/coreSyn/TrieMap.hs                        | 23 +++++--
 compiler/simplStg/RepType.hs                       |  2 +-
 compiler/typecheck/TcCanonical.hs                  | 12 ++--
 compiler/typecheck/TcErrors.hs                     |  2 +-
 compiler/typecheck/TcForeign.hs                    |  2 +-
 compiler/typecheck/TcGenFunctor.hs                 |  2 +-
 compiler/typecheck/TcHsType.hs                     |  2 +-
 compiler/typecheck/TcInteract.hs                   |  4 +-
 compiler/typecheck/TcType.hs                       | 65 ++++++------------
 compiler/typecheck/TcTypeable.hs                   |  4 +-
 compiler/typecheck/TcUnify.hs                      | 22 +++----
 compiler/typecheck/TcValidity.hs                   |  8 +--
 compiler/types/Kind.hs                             | 17 +++--
 compiler/types/Type.hs                             | 77 ++++++++++++++++++----
 compiler/types/Type.hs-boot                        |  3 +-
 compiler/types/Unify.hs                            | 13 ++--
 .../tests/roles/should_compile/Roles14.stderr      |  5 +-
 testsuite/tests/roles/should_compile/Roles3.stderr | 12 ++--
 testsuite/tests/roles/should_compile/Roles4.stderr |  7 +-
 testsuite/tests/roles/should_compile/T8958.stderr  |  8 ++-
 testsuite/tests/typecheck/should_run/T11715.hs     | 21 ++++++
 testsuite/tests/typecheck/should_run/T11715.stderr |  3 +
 testsuite/tests/typecheck/should_run/TypeOf.stdout | 12 ++--
 .../tests/typecheck/should_run/TypeRep.stdout      | 10 +--
 testsuite/tests/typecheck/should_run/all.T         |  1 +
 25 files changed, 212 insertions(+), 125 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 6575f4b635a393775295798ca86c7c3ba00819be


More information about the ghc-commits mailing list