From daac527a2a5d8b2b85fcd30b99ef2cc3a036c2c4 Mon Sep 17 00:00:00 2001 From: krasimir Date: Sun, 19 Jun 2005 08:41:40 +0000 Subject: [PATCH] [project @ 2005-06-19 08:41:40 by krasimir] Add pprTyThingHdr function. --- ghc/compiler/main/PprTyThing.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ghc/compiler/main/PprTyThing.hs b/ghc/compiler/main/PprTyThing.hs index fc53e72..09b7af6 100644 --- a/ghc/compiler/main/PprTyThing.hs +++ b/ghc/compiler/main/PprTyThing.hs @@ -11,6 +11,7 @@ module PprTyThing ( pprTyThingInContext, pprTyThingLoc, pprTyThingInContextLoc, + pprTyThingHdr ) where #include "HsVersions.h" @@ -53,6 +54,15 @@ pprTyThingInContext exts (AnId id) = pprIdInContext exts id pprTyThingInContext exts (ADataCon dataCon) = pprDataCon exts dataCon pprTyThingInContext exts (ATyCon tyCon) = pprTyCon exts tyCon pprTyThingInContext exts (AClass cls) = pprClass exts cls + +-- | Pretty-prints the 'TyThing' header. For functions and data constructors +-- the function is equivalent to 'pprTyThing' but for type constructors +-- and classes it prints only the header part of the declaration. +pprTyThingHdr :: Bool -> TyThing -> SDoc +pprTyThingHdr exts (AnId id) = pprId exts id +pprTyThingHdr exts (ADataCon dataCon) = pprDataConSig exts dataCon +pprTyThingHdr exts (ATyCon tyCon) = pprTyConHdr exts tyCon +pprTyThingHdr exts (AClass cls) = pprClassHdr exts cls pprTyConHdr exts tyCon = ptext keyword <+> ppr_bndr tyCon <+> hsep (map ppr vars) -- 1.7.10.4