projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4d60ffc
)
Minor refactoring: give an explicit name to the pretty-printing function for TyThing...
author
simonpj@microsoft.com
<unknown>
Tue, 11 Sep 2007 08:50:05 +0000
(08:50 +0000)
committer
simonpj@microsoft.com
<unknown>
Tue, 11 Sep 2007 08:50:05 +0000
(08:50 +0000)
compiler/main/HscTypes.lhs
patch
|
blob
|
history
compiler/typecheck/TcRnTypes.lhs
patch
|
blob
|
history
compiler/types/Type.lhs
patch
|
blob
|
history
compiler/types/TypeRep.lhs
patch
|
blob
|
history
diff --git
a/compiler/main/HscTypes.lhs
b/compiler/main/HscTypes.lhs
index
34d4e02
..
43063be
100644
(file)
--- a/
compiler/main/HscTypes.lhs
+++ b/
compiler/main/HscTypes.lhs
@@
-908,16
+908,16
@@
lookupType dflags hpt pte name
\begin{code}
tyThingTyCon (ATyCon tc) = tc
\begin{code}
tyThingTyCon (ATyCon tc) = tc
-tyThingTyCon other = pprPanic "tyThingTyCon" (ppr other)
+tyThingTyCon other = pprPanic "tyThingTyCon" (pprTyThing other)
tyThingClass (AClass cls) = cls
tyThingClass (AClass cls) = cls
-tyThingClass other = pprPanic "tyThingClass" (ppr other)
+tyThingClass other = pprPanic "tyThingClass" (pprTyThing other)
tyThingDataCon (ADataCon dc) = dc
tyThingDataCon (ADataCon dc) = dc
-tyThingDataCon other = pprPanic "tyThingDataCon" (ppr other)
+tyThingDataCon other = pprPanic "tyThingDataCon" (pprTyThing other)
tyThingId (AnId id) = id
tyThingId (AnId id) = id
-tyThingId other = pprPanic "tyThingId" (ppr other)
+tyThingId other = pprPanic "tyThingId" (pprTyThing other)
\end{code}
%************************************************************************
\end{code}
%************************************************************************
diff --git
a/compiler/typecheck/TcRnTypes.lhs
b/compiler/typecheck/TcRnTypes.lhs
index
ec2f5da
..
1e03afd
100644
(file)
--- a/
compiler/typecheck/TcRnTypes.lhs
+++ b/
compiler/typecheck/TcRnTypes.lhs
@@
-470,7
+470,7
@@
data RefinementVisibility
-- GADT refinement
instance Outputable TcTyThing where -- Debugging only
-- GADT refinement
instance Outputable TcTyThing where -- Debugging only
- ppr (AGlobal g) = ppr g
+ ppr (AGlobal g) = pprTyThing g
ppr elt@(ATcId {}) = text "Identifier" <>
ifPprDebug (brackets (ppr (tct_id elt) <> dcolon <> ppr (tct_type elt) <> comma
<+> ppr (tct_level elt) <+> ppr (tct_co elt)))
ppr elt@(ATcId {}) = text "Identifier" <>
ifPprDebug (brackets (ppr (tct_id elt) <> dcolon <> ppr (tct_type elt) <> comma
<+> ppr (tct_level elt) <+> ppr (tct_co elt)))
diff --git
a/compiler/types/Type.lhs
b/compiler/types/Type.lhs
index
b6b246b
..
c1e0544
100644
(file)
--- a/
compiler/types/Type.lhs
+++ b/
compiler/types/Type.lhs
@@
-105,7
+105,7
@@
module Type (
substPred, substTyVar, substTyVars, substTyVarBndr, deShadowTy, lookupTyVar,
-- Pretty-printing
substPred, substTyVar, substTyVars, substTyVarBndr, deShadowTy, lookupTyVar,
-- Pretty-printing
- pprType, pprParendType, pprTypeApp, pprTyThingCategory, pprForAll,
+ pprType, pprParendType, pprTypeApp, pprTyThingCategory, pprTyThing, pprForAll,
pprPred, pprTheta, pprThetaArrow, pprClassPred, pprKind, pprParendKind
) where
pprPred, pprTheta, pprThetaArrow, pprClassPred, pprKind, pprParendKind
) where
diff --git
a/compiler/types/TypeRep.lhs
b/compiler/types/TypeRep.lhs
index
1b2f56d
..
c694dc8
100644
(file)
--- a/
compiler/types/TypeRep.lhs
+++ b/
compiler/types/TypeRep.lhs
@@
-23,7
+23,7
@@
module TypeRep (
-- Pretty-printing
pprType, pprParendType, pprTypeApp,
-- Pretty-printing
pprType, pprParendType, pprTypeApp,
- pprTyThingCategory,
+ pprTyThing, pprTyThingCategory,
pprPred, pprTheta, pprForAll, pprThetaArrow, pprClassPred,
-- Kinds
pprPred, pprTheta, pprForAll, pprThetaArrow, pprClassPred,
-- Kinds
@@
-292,8
+292,11
@@
data TyThing = AnId Id
| ATyCon TyCon
| AClass Class
| ATyCon TyCon
| AClass Class
-instance Outputable TyThing where
- ppr thing = pprTyThingCategory thing <+> quotes (ppr (getName thing))
+instance Outputable TyThing where
+ ppr = pprTyThing
+
+pprTyThing :: TyThing -> SDoc
+pprTyThing thing = pprTyThingCategory thing <+> quotes (ppr (getName thing))
pprTyThingCategory :: TyThing -> SDoc
pprTyThingCategory (ATyCon _) = ptext SLIT("Type constructor")
pprTyThingCategory :: TyThing -> SDoc
pprTyThingCategory (ATyCon _) = ptext SLIT("Type constructor")