[commit: ghc] wip/spj-early-inline2: Improve pretty-printing of types (b3b0015)

git at git.haskell.org git at git.haskell.org
Tue Feb 21 23:27:16 UTC 2017


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

On branch  : wip/spj-early-inline2
Link       : http://ghc.haskell.org/trac/ghc/changeset/b3b0015cb374298256749931b35d45634bf70b9d/ghc

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

commit b3b0015cb374298256749931b35d45634bf70b9d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Feb 17 12:30:35 2017 +0000

    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.


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

b3b0015cb374298256749931b35d45634bf70b9d
 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     |   1 +
 10 files changed, 136 insertions(+), 104 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 b3b0015cb374298256749931b35d45634bf70b9d


More information about the ghc-commits mailing list