From ced09a6a2923e4f49ff345d4a28ea11a3b28c4ad Mon Sep 17 00:00:00 2001 From: "Dr. ERDI Gergo" <gergo@erdi.hu> Date: Fri, 14 Mar 2014 22:17:45 +0800 Subject: [PATCH] Reinstate pretty-printing of AnIds via pprId (#8776) --- compiler/main/PprTyThing.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/main/PprTyThing.hs b/compiler/main/PprTyThing.hs index fb92b5a87c23..1fd5d0cbcfce 100644 --- a/compiler/main/PprTyThing.hs +++ b/compiler/main/PprTyThing.hs @@ -104,6 +104,7 @@ pprTyThingHdr = ppr_ty_thing Nothing -- 'TyCon' tidying happening in 'tyThingToIfaceDecl'. See #8776 for details. ppr_ty_thing :: Maybe ShowSub -> TyThing -> SDoc ppr_ty_thing mss tyThing = case tyThing of + AnId id -> pprId id ATyCon tyCon -> case mss of Nothing -> pprTyConHdr tyCon Just ss -> pprTyCon ss tyCon @@ -147,6 +148,11 @@ pprClassHdr cls where (tvs, funDeps) = classTvsFds cls +pprId :: Var -> SDoc +pprId ident + = hang (ppr_bndr ident <+> dcolon) + 2 (pprTypeForUser (idType ident)) + pprTypeForUser :: Type -> SDoc -- We do two things here. -- a) We tidy the type, regardless -- GitLab