X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypes%2FPprType.lhs;h=00ff1e872010de91294b2e5aaeee1195ea72f8a6;hb=f1e626d0add71aa523457c55c28c8e53d77e5a58;hp=6b22faa886d3612a3128877b1957f2adea554d84;hpb=495ef8bd9ef30bffe50ea399b91e3ba09646b59a;p=ghc-hetmet.git diff --git a/ghc/compiler/types/PprType.lhs b/ghc/compiler/types/PprType.lhs index 6b22faa..00ff1e8 100644 --- a/ghc/compiler/types/PprType.lhs +++ b/ghc/compiler/types/PprType.lhs @@ -30,7 +30,6 @@ import Type ( PredType(..), ThetaType, import Var ( TyVar, tyVarKind, tyVarName, setTyVarName ) -import VarEnv import TyCon ( TyCon, isPrimTyCon, isTupleTyCon, isUnboxedTupleTyCon, maybeTyConSingleCon, isEnumerationTyCon, tyConArity, tyConUnique @@ -44,7 +43,6 @@ import Outputable import PprEnv import Unique ( Uniquable(..) ) import Unique -- quite a few *Keys -import Util \end{code} %************************************************************************ @@ -69,10 +67,11 @@ pprParendKind = pprParendType pprPred :: PredType -> SDoc pprPred (Class clas tys) = pprConstraint clas tys -pprPred (IParam n ty) = hsep [ppr n, ptext SLIT("::"), ppr ty] +pprPred (IParam n ty) = hsep [ptext SLIT("?") <> ppr n, + ptext SLIT("::"), ppr ty] pprConstraint :: Class -> [Type] -> SDoc -pprConstraint clas tys = ppr clas <+> hsep (map (pprParendType) tys) +pprConstraint clas tys = ppr clas <+> hsep (map pprParendType tys) pprTheta :: ThetaType -> SDoc pprTheta theta = parens (hsep (punctuate comma (map pprPred theta))) @@ -177,12 +176,9 @@ ppr_ty env ctxt_prec ty@(ForAllTy _ _) pp_tyvars = hsep (map (pBndr env LambdaBind) tyvars) ppr_theta [] = empty - ppr_theta theta = parens (hsep (punctuate comma (map ppr_pred theta))) + ppr_theta theta = parens (hsep (punctuate comma (map (ppr_pred env) theta))) <+> ptext SLIT("=>") - ppr_pred (Class clas tys) = ppr clas <+> hsep (map (ppr_ty env tYCON_PREC) tys) - ppr_pred (IParam n ty) = hsep [{- char '?' <> -} ppr n, text "::", - ppr_ty env tYCON_PREC ty] ppr_ty env ctxt_prec (FunTy ty1 ty2) = maybeParen ctxt_prec fUN_PREC (sep (ppr_ty env fUN_PREC ty1 : pp_rest ty2)) @@ -226,11 +222,6 @@ ppr_pred env (Class clas tys) = ppr clas <+> hsep (map (ppr_ty env tYCON_PREC) tys) ppr_pred env (IParam n ty) = hsep [char '?' <> ppr n, text "::", ppr_ty env tYCON_PREC ty] - -{- -ppr_dict env ctxt (clas, tys) = ppr clas <+> - hsep (map (ppr_ty env tYCON_PREC) tys) --} \end{code} \begin{code}