[commit: ghc] master: Improve pretty-printing of types (871b63e)

git at git.haskell.org git at git.haskell.org
Wed Mar 1 01:20:32 UTC 2017


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

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

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

commit 871b63e4ea95d4c516d31378d0475167e75caa01
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Feb 28 20:20:21 2017 -0500

    Improve pretty-printing of types
    
    When doing debug-printing it's really important that the free vars
    of a type are printed with their uniques.  The IfaceTcTyVar thing
    was a stab in that direction, but it only worked for TcTyVars, not
    TyVars.
    
    This patch does it properly, by keeping track of the free vars of the
    type when translating Type -> IfaceType, and passing that down through
    toIfaceTypeX.  Then when we find a variable, look in that set, and
    translate it to IfaceFreeTyVar if so.  (I renamed IfaceTcTyVar to
    IfaceFreeTyVar.)
    
    Fiddly but not difficult.
    
    Reviewers: austin, goldfire, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D3201


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

871b63e4ea95d4c516d31378d0475167e75caa01
 compiler/backpack/RnModIface.hs                    |   4 +-
 compiler/iface/IfaceSyn.hs                         |   2 +-
 compiler/iface/IfaceType.hs                        |  38 +++---
 compiler/iface/TcIface.hs                          |   2 +-
 compiler/iface/ToIface.hs                          | 147 ++++++++++++---------
 compiler/iface/ToIface.hs-boot                     |   2 +
 compiler/typecheck/TcRnTypes.hs                    |   5 +-
 compiler/types/TyCoRep.hs                          |  37 +++---
 compiler/types/Type.hs                             |   2 +-
 compiler/types/Type.hs-boot                        |   2 +-
 testsuite/tests/deriving/should_fail/T7148.stderr  |   8 +-
 testsuite/tests/th/T8761.stderr                    |  57 ++++----
 .../tests/typecheck/should_fail/T12785b.stderr     |  15 +--
 13 files changed, 175 insertions(+), 146 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 871b63e4ea95d4c516d31378d0475167e75caa01


More information about the ghc-commits mailing list