summaryrefslogtreecommitdiff
path: root/compiler/GHC
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-04-05 16:58:14 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-04-09 03:32:47 -0400
commit28d2d6460e5af75f07e64c3d8ed1a3ad70d64aa6 (patch)
tree6be719186994b73ea4462addc2e387f13c229c75 /compiler/GHC
parentd4a71b0cbfe1307b022ac3746c9a3a79bc5b90b8 (diff)
downloadhaskell-28d2d6460e5af75f07e64c3d8ed1a3ad70d64aa6.tar.gz
Don't tidy type in pprTypeForUser
There used to be some cases were kinds were not generalised properly before being printed in GHCi. This seems to have changed in the past so now it's uncessary to tidy before printing out the test case. ``` > :set -XPolyKinds > data A x y > :k A k1 -> k2 -> A ``` This tidying was causing issues with an attempt to increase sharing by making `mkTyConApp` (see !4762)
Diffstat (limited to 'compiler/GHC')
-rw-r--r--compiler/GHC/Types/TyThing/Ppr.hs17
1 files changed, 2 insertions, 15 deletions
diff --git a/compiler/GHC/Types/TyThing/Ppr.hs b/compiler/GHC/Types/TyThing/Ppr.hs
index aad90365a7..b4084f9bf8 100644
--- a/compiler/GHC/Types/TyThing/Ppr.hs
+++ b/compiler/GHC/Types/TyThing/Ppr.hs
@@ -13,7 +13,6 @@ module GHC.Types.TyThing.Ppr (
pprTyThingLoc,
pprTyThingInContextLoc,
pprTyThingHdr,
- pprTypeForUser,
pprFamInst
) where
@@ -25,12 +24,11 @@ import GHC.Driver.Ppr (warnPprTrace)
import GHC.Types.TyThing ( TyThing(..), tyThingParent_maybe )
import GHC.Types.Name
-import GHC.Types.Var.Env( emptyTidyEnv )
-import GHC.Core.Type ( Type, ArgFlag(..), mkTyVarBinders, tidyOpenType )
+import GHC.Core.Type ( ArgFlag(..), mkTyVarBinders )
import GHC.Core.Coercion.Axiom ( coAxiomTyCon )
import GHC.Core.FamInstEnv( FamInst(..), FamFlavor(..) )
-import GHC.Core.TyCo.Ppr ( pprUserForAll, pprTypeApp, pprSigmaType )
+import GHC.Core.TyCo.Ppr ( pprUserForAll, pprTypeApp )
import GHC.Iface.Syntax ( ShowSub(..), ShowHowMuch(..), AltPpr(..)
, showToHeader, pprIfaceDecl )
@@ -192,17 +190,6 @@ pprTyThing ss ty_thing
Nothing -> WARN( True, ppr name ) Nothing
-- Nothing is unexpected here; TyThings have External names
-pprTypeForUser :: Type -> SDoc
--- The type is tidied
-pprTypeForUser ty
- = pprSigmaType tidy_ty
- where
- (_, tidy_ty) = tidyOpenType emptyTidyEnv ty
- -- Often the types/kinds we print in ghci are fully generalised
- -- and have no free variables, but it turns out that we sometimes
- -- print un-generalised kinds (eg when doing :k T), so it's
- -- better to use tidyOpenType here
-
showWithLoc :: SDoc -> SDoc -> SDoc
showWithLoc loc doc
= hang doc 2 (char '\t' <> comment <+> loc)