Commit b579a3ee authored by simonpj's avatar simonpj
Browse files

[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) ***
parent 373dd3e0
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment