From b579a3ee8d06e269c7c54c91eaba1ee483fdd04b Mon Sep 17 00:00:00 2001 From: simonpj Date: Tue, 19 Dec 2000 08:38:20 +0000 Subject: [PATCH] [project @ 2000-12-19 08:38:20 by simonpj] Print tuple parens correctly in types. This has been wrong for ages! Quite how it has survived is beyond me. *** BACK-PATCH TO 4.08 PLEASE (I THINK) *** --- ghc/compiler/types/PprType.lhs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ghc/compiler/types/PprType.lhs b/ghc/compiler/types/PprType.lhs index fc80b50..87ddcfa 100644 --- a/ghc/compiler/types/PprType.lhs +++ b/ghc/compiler/types/PprType.lhs @@ -26,7 +26,7 @@ import Type ( PredType(..), ThetaType, predRepTy, isUTyVar ) import Var ( TyVar, tyVarKind ) -import TyCon ( TyCon, isPrimTyCon, isTupleTyCon, isUnboxedTupleTyCon, +import TyCon ( TyCon, isPrimTyCon, isTupleTyCon, tupleTyConBoxity, maybeTyConSingleCon, isEnumerationTyCon, tyConArity, tyConName ) @@ -39,6 +39,7 @@ import Name ( getOccString, getOccName ) import Outputable import PprEnv import Unique ( Uniquable(..) ) +import BasicTypes ( tupleParens ) import PrelNames -- quite a few *Keys \end{code} @@ -132,11 +133,7 @@ ppr_ty env ctxt_prec ty@(TyConApp tycon tys) -- TUPLE CASE (boxed and unboxed) | isTupleTyCon tycon && length tys == tyConArity tycon -- no magic if partially applied - = parens tys_w_commas - - | isUnboxedTupleTyCon tycon - && length tys == tyConArity tycon -- no magic if partially applied - = parens (char '#' <+> tys_w_commas <+> char '#') + = tupleParens (tupleTyConBoxity tycon) tys_w_commas -- LIST CASE | tycon `hasKey` listTyConKey && n_tys == 1 -- 1.7.10.4