#include "HsVersions.h"
+import {-# SOURCE #-} HsExpr ( HsSplice, pprSplice )
+
import TcType ( Type, Kind, liftedTypeKind, eqKind )
import Type ( {- instance Outputable Kind -}, pprParendKind, pprKind )
import Name ( Name, mkInternalName )
| HsKindSig (LHsType name) -- (ty :: kind)
Kind -- A type with a kind signature
+ | HsSpliceTy (HsSplice name)
+
data HsExplicitForAll = Explicit | Implicit
-----------------------
\begin{code}
splitHsInstDeclTy
- :: Outputable name
+ :: OutputableBndr name
=> HsType name
-> ([LHsTyVarBndr name], HsContext name, name, [LHsType name])
-- Split up an instance decl type, returning the pieces
don't change the printing format lightly
\begin{code}
-instance (Outputable name) => Outputable (HsType name) where
+instance (OutputableBndr name) => Outputable (HsType name) where
ppr ty = pprHsType ty
instance (Outputable name) => Outputable (HsTyVarBndr name) where
ppr (UserTyVar name) = ppr name
ppr (KindedTyVar name kind) = pprHsTyVarBndr name kind
-instance Outputable name => Outputable (HsPred name) where
+instance OutputableBndr name => Outputable (HsPred name) where
ppr (HsClassP clas tys) = ppr clas <+> hsep (map (pprParendHsType.unLoc) tys)
ppr (HsIParam n ty) = hsep [ppr n, dcolon, ppr ty]
is_explicit = case exp of {Explicit -> True; Implicit -> False}
forall_part = ptext SLIT("forall") <+> interppSP tvs <> dot
-pprHsContext :: (Outputable name) => HsContext name -> SDoc
+pprHsContext :: (OutputableBndr name) => HsContext name -> SDoc
pprHsContext [] = empty
pprHsContext cxt = ppr_hs_context cxt <+> ptext SLIT("=>")
-- printing works more-or-less as for Types
-pprHsType, pprParendHsType :: (Outputable name) => HsType name -> SDoc
+pprHsType, pprParendHsType :: (OutputableBndr name) => HsType name -> SDoc
pprHsType ty = getPprStyle $ \sty -> ppr_mono_ty pREC_TOP (prepare sty ty)
pprParendHsType ty = ppr_mono_ty pREC_CON ty
ppr_mono_ty ctxt_prec (HsPArrTy ty) = pabrackets (ppr_mono_lty pREC_TOP ty)
ppr_mono_ty ctxt_prec (HsPredTy pred) = braces (ppr pred)
ppr_mono_ty ctxt_prec (HsNumTy n) = integer n -- generics only
+ppr_mono_ty ctxt_prec (HsSpliceTy s) = pprSplice s
ppr_mono_ty ctxt_prec (HsAppTy fun_ty arg_ty)
= maybeParen ctxt_prec pREC_CON $