diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2016-11-24 12:32:11 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2016-11-25 17:46:50 +0000 |
commit | 5f349fe24066e7b0af85934664e27636d2e84fe5 (patch) | |
tree | 1f2ca9aad2a1d47b06675ef7ae3eb534902e8478 /compiler/backpack | |
parent | 12eff239236c43ee903d8e29287a36c3d8e24747 (diff) | |
download | haskell-5f349fe24066e7b0af85934664e27636d2e84fe5.tar.gz |
Improve pretty-printing of types
In this commit
commit 6c0f10fac767c49b65ed71e8eb8e78ca4f9062d5
Author: Ben Gamari <bgamari.foss@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.
Diffstat (limited to 'compiler/backpack')
-rw-r--r-- | compiler/backpack/RnModIface.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/backpack/RnModIface.hs b/compiler/backpack/RnModIface.hs index e70254243f..4861628764 100644 --- a/compiler/backpack/RnModIface.hs +++ b/compiler/backpack/RnModIface.hs @@ -617,7 +617,8 @@ rnIfaceIdDetails (IfRecSelId (Right decl) b) = IfRecSelId <$> fmap Right (rnIfac rnIfaceIdDetails details = pure details rnIfaceType :: Rename IfaceType -rnIfaceType (IfaceTyVar n) = pure (IfaceTyVar n) +rnIfaceType (IfaceTcTyVar n) = pure (IfaceTcTyVar n) +rnIfaceType (IfaceTyVar n) = pure (IfaceTyVar n) rnIfaceType (IfaceAppTy t1 t2) = IfaceAppTy <$> rnIfaceType t1 <*> rnIfaceType t2 rnIfaceType (IfaceLitTy l) = return (IfaceLitTy l) |