(ptext SLIT("In") <+> doc))
ctxtErr explicit_forall doc tyvars constraint ty
- = sep [ptext SLIT("None of the type variable(s) in the constraint") <+> quotes (pprClassAssertion constraint) <+>
- ptext SLIT("does not mention any of"),
+ = sep [ptext SLIT("None of the type variable(s) in the constraint") <+> quotes (pprClassAssertion constraint),
if explicit_forall then
nest 4 (ptext SLIT("is universally quantified (i.e. bound by the forall)"))
else
returnTc ( generalised_arg, free_insts,
arg', sig_tau, lie_arg )
where
- sig_msg ty = ptext SLIT("In an expression with expected type:") <+> ppr ty
+ sig_msg ty = sep [ptext SLIT("In an expression with expected type:"),
+ nest 4 (ppr ty)]
\end{code}
%************************************************************************
-- The type checker occasionally prints a type in an error message,
-- and it had better come out looking like a user type
sep [ ptext SLIT("forall") <+> pp_tyvars <> ptext SLIT("."),
- ppr_theta theta <+> ptext SLIT("=>"),
+ ppr_theta theta,
ppr_ty env tOP_PREC tau
]
where
pp_tyvars = hsep (map (pBndr env LambdaBind) tyvars)
- ppr_theta theta = parens (hsep (punctuate comma (map ppr_dict theta)))
+ ppr_theta [] = empty
+ ppr_theta theta = parens (hsep (punctuate comma (map ppr_dict theta)))
+ <+> ptext SLIT("=>")
+
ppr_dict (clas,tys) = ppr clas <+> hsep (map (ppr_ty env tYCON_PREC) tys)