From da95f4a039f7bc12b625338353df8399dec41c5e Mon Sep 17 00:00:00 2001 From: simonpj Date: Fri, 1 Oct 2004 10:09:36 +0000 Subject: [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. --- ghc/compiler/types/TypeRep.lhs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'ghc/compiler/types/TypeRep.lhs') 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 -- cgit v1.2.1