diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2017-02-28 20:20:21 -0500 |
---|---|---|
committer | David Feuer <David.Feuer@gmail.com> | 2017-02-28 20:20:22 -0500 |
commit | 871b63e4ea95d4c516d31378d0475167e75caa01 (patch) | |
tree | 9291801818863be4269fdc5cb3a313645b13dd8c /compiler/backpack | |
parent | cdf6b69563f66b3ef26481003654d645466e5450 (diff) | |
download | haskell-871b63e4ea95d4c516d31378d0475167e75caa01.tar.gz |
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
Diffstat (limited to 'compiler/backpack')
-rw-r--r-- | compiler/backpack/RnModIface.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/backpack/RnModIface.hs b/compiler/backpack/RnModIface.hs index 7180918ff7..7696d5f075 100644 --- a/compiler/backpack/RnModIface.hs +++ b/compiler/backpack/RnModIface.hs @@ -674,8 +674,8 @@ rnIfaceIdDetails (IfRecSelId (Right decl) b) = IfRecSelId <$> fmap Right (rnIfac rnIfaceIdDetails details = pure details rnIfaceType :: Rename IfaceType -rnIfaceType (IfaceTcTyVar n) = pure (IfaceTcTyVar n) -rnIfaceType (IfaceTyVar n) = pure (IfaceTyVar n) +rnIfaceType (IfaceFreeTyVar n) = pure (IfaceFreeTyVar n) +rnIfaceType (IfaceTyVar n) = pure (IfaceTyVar n) rnIfaceType (IfaceAppTy t1 t2) = IfaceAppTy <$> rnIfaceType t1 <*> rnIfaceType t2 rnIfaceType (IfaceLitTy l) = return (IfaceLitTy l) |