X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FPprTyThing.hs;h=c379d972d968d681a6f4471b76922d7701c4ac4b;hb=8cf861ba91941412e93f70a916233223aebf686e;hp=f8d5db3a40d34558bf4b00f86abe6cfa28c212aa;hpb=982c1f494de8a691294a95aee108e765c3f592a0;p=ghc-hetmet.git diff --git a/compiler/main/PprTyThing.hs b/compiler/main/PprTyThing.hs index f8d5db3..c379d97 100644 --- a/compiler/main/PprTyThing.hs +++ b/compiler/main/PprTyThing.hs @@ -28,7 +28,7 @@ module PprTyThing ( import qualified GHC import GHC ( TyThing(..) ) -import TyCon ( tyConFamInst_maybe ) +import TyCon ( tyConFamInst_maybe, isAlgTyCon, tyConStupidTheta ) import Type ( TyThing(..), tidyTopType, pprTypeApp ) import TcType ( tcMultiSplitSigmaTy, mkPhiTy ) import SrcLoc ( SrcSpan ) @@ -86,7 +86,7 @@ pprTyConHdr pefas tyCon | Just (fam_tc, tys) <- tyConFamInst_maybe tyCon = ptext keyword <+> ptext SLIT("instance") <+> pprTypeApp tyCon (ppr_bndr tyCon) tys | otherwise - = ptext keyword <+> opt_family <+> ppr_bndr tyCon <+> hsep (map ppr vars) + = ptext keyword <+> opt_family <+> opt_stupid <+> ppr_bndr tyCon <+> hsep (map ppr vars) where vars | GHC.isPrimTyCon tyCon || GHC.isFunTyCon tyCon = take (GHC.tyConArity tyCon) GHC.alphaTyVars @@ -100,6 +100,10 @@ pprTyConHdr pefas tyCon | GHC.isOpenTyCon tyCon = ptext SLIT("family") | otherwise = empty + opt_stupid -- The "stupid theta" part of the declaration + | isAlgTyCon tyCon = GHC.pprThetaArrow (tyConStupidTheta tyCon) + | otherwise = empty -- Returns 'empty' if null theta + pprDataConSig pefas dataCon = ppr_bndr dataCon <+> dcolon <+> pprTypeForUser pefas (GHC.dataConType dataCon) @@ -190,7 +194,7 @@ pprDataConDecl pefas gadt_style show_label dataCon -- printing out the dataCon as a type signature, in GADT style pp_tau = foldr add (ppr res_ty) tys_w_strs - add (str,ty) pp_ty = pprBangTy str ty <+> arrow <+> pp_ty + add str_ty pp_ty = pprParendBangTy str_ty <+> arrow <+> pp_ty pprParendBangTy (strict,ty) | GHC.isMarkedStrict strict = char '!' <> GHC.pprParendType ty