--- Some help functions
-ppr_corner sty env ctxt_prec (TyConTy FunTyCon usage) arg_tys
- | length arg_tys == 2
- = ppr_ty sty env ctxt_prec (FunTy ty1 ty2 usage)
- where
- (ty1:ty2:_) = arg_tys
-
-ppr_corner sty env ctxt_prec (TyConTy (TupleTyCon _ _ a) usage) arg_tys
- = --ASSERT(length arg_tys == a)
- (if (length arg_tys /= a) then pprTrace "ppr_corner:" (ppCat [ppInt a, ppInterleave ppComma (map (pprGenType PprDebug) arg_tys)]) else id) $
- ppBesides [ppLparen, arg_tys_w_commas, ppRparen]
- where
- arg_tys_w_commas = ppIntersperse pp'SP (map (ppr_ty sty env tOP_PREC) arg_tys)
-
-ppr_corner sty env ctxt_prec (TyConTy tycon usage) arg_tys
- | tycon == listTyCon
- = ASSERT(length arg_tys == 1)
- ppBesides [ppLbrack, ppr_ty sty env tOP_PREC ty1, ppRbrack]
- where
- (ty1:_) = arg_tys
-
-ppr_corner sty env ctxt_prec (TyConTy tycon usage) arg_tys
- = ppr_app sty env ctxt_prec (ppr sty tycon) arg_tys
-
-ppr_corner sty env ctxt_prec (TyVarTy tyvar) arg_tys
- = ppr_app sty env ctxt_prec (ppr_tyvar env tyvar) arg_tys
-
-
-ppr_app sty env ctxt_prec pp_fun []
- = pp_fun
-ppr_app sty env ctxt_prec pp_fun arg_tys
- = maybeParen ctxt_prec tYCON_PREC (ppCat [pp_fun, arg_tys_w_spaces])
- where
- arg_tys_w_spaces = ppIntersperse ppSP (map (ppr_ty sty env tYCON_PREC) arg_tys)
-
-
-ppr_dict sty env ctxt_prec (clas, ty)
- = maybeParen ctxt_prec tYCON_PREC
- (ppCat [ppr sty clas, ppr_ty sty env tYCON_PREC ty])