Changeset View
Changeset View
Standalone View
Standalone View
compiler/types/TypeRep.hs
Show First 20 Lines • Show All 697 Lines • ▼ Show 20 Line(s) | |||||
698 | pprTypeApp tc tys = pprTyTcApp TopPrec tc tys | 698 | pprTypeApp tc tys = pprTyTcApp TopPrec tc tys | ||
699 | -- We have to use ppr on the TyCon (not its name) | 699 | -- We have to use ppr on the TyCon (not its name) | ||
700 | -- so that we get promotion quotes in the right place | 700 | -- so that we get promotion quotes in the right place | ||
701 | 701 | | |||
702 | pprTyTcApp :: TyPrec -> TyCon -> [Type] -> SDoc | 702 | pprTyTcApp :: TyPrec -> TyCon -> [Type] -> SDoc | ||
703 | -- Used for types only; so that we can make a | 703 | -- Used for types only; so that we can make a | ||
704 | -- special case for type-level lists | 704 | -- special case for type-level lists | ||
705 | pprTyTcApp p tc tys | 705 | pprTyTcApp p tc tys | ||
706 | | tc `hasKey` ipClassNameKey | 706 | | tc `hasKey` ipTyConKey | ||
707 | , [LitTy (StrTyLit n),ty] <- tys | 707 | , [LitTy (StrTyLit n),ty] <- tys | ||
708 | = maybeParen p FunPrec $ | 708 | = maybeParen p FunPrec $ | ||
709 | char '?' <> ftext n <> ptext (sLit "::") <> ppr_type TopPrec ty | 709 | char '?' <> ftext n <> ptext (sLit "::") <> ppr_type TopPrec ty | ||
710 | 710 | | |||
711 | | tc `hasKey` consDataConKey | 711 | | tc `hasKey` consDataConKey | ||
712 | , [_kind,ty1,ty2] <- tys | 712 | , [_kind,ty1,ty2] <- tys | ||
713 | = sdocWithDynFlags $ \dflags -> | 713 | = sdocWithDynFlags $ \dflags -> | ||
714 | if gopt Opt_PrintExplicitKinds dflags then pprTcApp p ppr_type tc tys | 714 | if gopt Opt_PrintExplicitKinds dflags then pprTcApp p ppr_type tc tys | ||
▲ Show 20 Lines • Show All 225 Lines • Show Last 20 Lines |