[commit: ghc] master: Improve pretty-printing of types (5f349fe)

git at git.haskell.org git at git.haskell.org
Fri Nov 25 17:47:13 UTC 2016


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

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

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

commit 5f349fe24066e7b0af85934664e27636d2e84fe5
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Nov 24 12:32:11 2016 +0000

    Improve pretty-printing of types
    
    In this commit
       commit 6c0f10fac767c49b65ed71e8eb8e78ca4f9062d5
       Author: Ben Gamari <bgamari.foss at gmail.com>
       Date:   Sun Nov 13 16:17:37 2016 -0500
    
        Kill Type pretty-printer
    
    we switched to pretty-printing a type by converting it to an
    IfaceType and pretty printing that.  Very good.
    
    This patch fixes two things
    
    * The new story is terrible for debug-printing with -ddump-tc-trace,
      because all the extra info in an open type was discarded ty the
      conversion to IfaceType.
    
      This patch adds IfaceTcTyVar to IfaceType, to carry a TcTyVar in
      debug situations.  Quite an easy change, happily.  These things
      never show up in interface files.
    
    * Now that we are going via IfaceType, it's essential to tidy before
      converting; otherwise
         forall k_23 k_34. blah
      is printed as
         forall k k. blah
      which is very unhelpful.  Again this only shows up in debug
      printing.


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

5f349fe24066e7b0af85934664e27636d2e84fe5
 compiler/backpack/RnModIface.hs |  3 ++-
 compiler/iface/IfaceSyn.hs      |  2 +-
 compiler/iface/IfaceType.hs     | 34 ++++++++++++++++++++++++++++++----
 compiler/iface/TcIface.hs       |  1 +
 compiler/iface/ToIface.hs       | 20 ++++++++++----------
 compiler/types/TyCoRep.hs       | 27 ++++++++++++++++++++-------
 6 files changed, 64 insertions(+), 23 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 5f349fe24066e7b0af85934664e27636d2e84fe5


More information about the ghc-commits mailing list