pprParendHsType, pprHsForAll, pprHsContext, ppr_hs_context, pprHsTyVarBndr
) where
-#include "HsVersions.h"
-
import {-# SOURCE #-} HsExpr ( HsSplice, pprSplice )
import Type
instance Outputable HsBang where
ppr (HsNoBang) = empty
ppr (HsStrict) = char '!'
- ppr (HsUnbox) = ptext SLIT("!!")
+ ppr (HsUnbox) = ptext (sLit "!!")
getBangType :: LHsType a -> LHsType a
getBangType (L _ (HsBangTy _ ty)) = ty
instance OutputableBndr name => Outputable (HsPred name) where
ppr (HsClassP clas tys) = ppr clas <+> hsep (map pprLHsType tys)
- ppr (HsEqualP t1 t2) = hsep [pprLHsType t1, ptext SLIT("~"),
+ ppr (HsEqualP t1 t2) = hsep [pprLHsType t1, ptext (sLit "~"),
pprLHsType t2]
ppr (HsIParam n ty) = hsep [ppr n, dcolon, ppr ty]
show_forall = opt_PprStyle_Debug
|| (not (null tvs) && is_explicit)
is_explicit = case exp of {Explicit -> True; Implicit -> False}
- forall_part = ptext SLIT("forall") <+> interppSP tvs <> dot
+ forall_part = ptext (sLit "forall") <+> interppSP tvs <> dot
pprHsContext :: (OutputableBndr name) => HsContext name -> SDoc
pprHsContext [] = empty
-pprHsContext cxt = ppr_hs_context cxt <+> ptext SLIT("=>")
+pprHsContext cxt = ppr_hs_context cxt <+> ptext (sLit "=>")
ppr_hs_context :: (OutputableBndr name) => HsContext name -> SDoc
ppr_hs_context [] = empty
-- But we still use the precedence stuff to add parens because
-- toHsType doesn't put in any HsParTys, so we may still need them
-ppr_mono_ty _ (HsDocTy ty doc)
- = ppr ty <+> ppr (unLoc doc)
+ppr_mono_ty ctxt_prec (HsDocTy ty doc)
+ = maybeParen ctxt_prec pREC_OP $
+ ppr_mono_lty pREC_OP ty <+> ppr (unLoc doc)
+ -- we pretty print Haddock comments on types as if they were
+ -- postfix operators
--------------------------
ppr_fun_ty :: (OutputableBndr name) => Int -> LHsType name -> LHsType name -> SDoc
p2 = ppr_mono_lty pREC_TOP ty2
in
maybeParen ctxt_prec pREC_FUN $
- sep [p1, ptext SLIT("->") <+> p2]
+ sep [p1, ptext (sLit "->") <+> p2]
--------------------------
pabrackets :: SDoc -> SDoc
-pabrackets p = ptext SLIT("[:") <> p <> ptext SLIT(":]")
+pabrackets p = ptext (sLit "[:") <> p <> ptext (sLit ":]")
\end{code}