From: krasimir Date: Sun, 19 Jun 2005 08:41:40 +0000 (+0000) Subject: [project @ 2005-06-19 08:41:40 by krasimir] X-Git-Tag: Initial_conversion_from_CVS_complete~420 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=daac527a2a5d8b2b85fcd30b99ef2cc3a036c2c4;p=ghc-hetmet.git [project @ 2005-06-19 08:41:40 by krasimir] Add pprTyThingHdr function. --- 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)