summaryrefslogtreecommitdiff
path: root/ghc/compiler/types/TypeRep.lhs
diff options
context:
space:
mode:
authorsimonpj <unknown>2004-10-01 10:09:36 +0000
committersimonpj <unknown>2004-10-01 10:09:36 +0000
commitda95f4a039f7bc12b625338353df8399dec41c5e (patch)
treebd3cacd44d63697567a9022f56147834ec753e29 /ghc/compiler/types/TypeRep.lhs
parent1276aa3fa5219898ddd1764579ade0c28995973b (diff)
downloadhaskell-da95f4a039f7bc12b625338353df8399dec41c5e.tar.gz
[project @ 2004-10-01 10:08:49 by simonpj]
----------------------------------- Do simple checking on hi-boot files ----------------------------------- This commit arranges that, when compiling A.hs, we compare the types we infer with those in A.hi-boot, if the latter exists. (Or, more accurately, if anything A.hs imports in turn imports A.hi-boot, directly or indirectly.) This has been on the to-do list forever.
Diffstat (limited to 'ghc/compiler/types/TypeRep.lhs')
-rw-r--r--ghc/compiler/types/TypeRep.lhs13
1 files changed, 8 insertions, 5 deletions
diff --git a/ghc/compiler/types/TypeRep.lhs b/ghc/compiler/types/TypeRep.lhs
index 287c2be5c5..5c4bd3315a 100644
--- a/ghc/compiler/types/TypeRep.lhs
+++ b/ghc/compiler/types/TypeRep.lhs
@@ -14,7 +14,7 @@ module TypeRep (
funTyCon,
-- Pretty-printing
- pprType, pprParendType,
+ pprType, pprParendType, pprTyThingCategory,
pprPred, pprTheta, pprThetaArrow, pprClassPred,
-- Re-export fromKind
@@ -251,10 +251,13 @@ data TyThing = AnId Id
| AClass Class
instance Outputable TyThing where
- ppr (AnId id) = ptext SLIT("AnId") <+> ppr id
- ppr (ATyCon tc) = ptext SLIT("ATyCon") <+> ppr tc
- ppr (AClass cl) = ptext SLIT("AClass") <+> ppr cl
- ppr (ADataCon dc) = ptext SLIT("ADataCon") <+> ppr (dataConName dc)
+ ppr thing = pprTyThingCategory thing <+> quotes (ppr (getName thing))
+
+pprTyThingCategory :: TyThing -> SDoc
+pprTyThingCategory (ATyCon _) = ptext SLIT("Type constructor")
+pprTyThingCategory (AClass _) = ptext SLIT("Class")
+pprTyThingCategory (AnId _) = ptext SLIT("Identifier")
+pprTyThingCategory (ADataCon _) = ptext SLIT("Data constructor")
instance NamedThing TyThing where -- Can't put this with the type
getName (AnId id) = getName id -- decl, because the DataCon instance