import CallConv ( CallConv, pprCallConv )
-- others:
-import Name ( NamedThing )
import Outputable
import SrcLoc ( SrcLoc )
import Util
\begin{code}
#ifdef DEBUG
-hsDeclName :: (NamedThing name, Outputable name, Outputable pat)
+hsDeclName :: (Outputable name, Outputable pat)
=> HsDecl name pat -> name
#endif
hsDeclName (TyClD decl) = tyClDeclName decl
\end{code}
\begin{code}
-instance (NamedThing name, Outputable name, Outputable pat)
+instance (Outputable name, Outputable pat)
=> Outputable (HsDecl name pat) where
ppr (TyClD dcl) = ppr dcl
#ifdef DEBUG
-- hsDeclName needs more context when DEBUG is on
-instance (NamedThing name, Outputable name, Outputable pat, Eq name)
+instance (Outputable name, Outputable pat, Eq name)
=> Eq (HsDecl name pat) where
d1 == d2 = hsDeclName d1 == hsDeclName d2
-instance (NamedThing name, Outputable name, Outputable pat, Ord name)
+instance (Outputable name, Outputable pat, Ord name)
=> Ord (HsDecl name pat) where
d1 `compare` d2 = hsDeclName d1 `compare` hsDeclName d2
#else
\end{code}
\begin{code}
-instance (NamedThing name, Outputable name, Outputable pat)
+instance (Outputable name, Outputable pat)
=> Outputable (TyClDecl name pat) where
ppr (TySynonym tycon tyvars mono_ty src_loc)
(HsType name)
SrcLoc
-instance (NamedThing name, Outputable name)
+instance (Outputable name)
=> Outputable (SpecDataSig name) where
ppr (SpecDataSig tycon ty _)
\end{code}
\begin{code}
-instance (NamedThing name, Outputable name) => Outputable (ConDecl name) where
+instance (Outputable name) => Outputable (ConDecl name) where
ppr (ConDecl con tvs cxt con_details loc)
= sep [pprForAll tvs, pprContext cxt, ppr_con_details con con_details]
\end{code}
\begin{code}
-instance (NamedThing name, Outputable name, Outputable pat)
+instance (Outputable name, Outputable pat)
=> Outputable (InstDecl name pat) where
ppr (InstDecl inst_ty binds uprags dfun_name src_loc)
= DefaultDecl [HsType name]
SrcLoc
-instance (NamedThing name, Outputable name)
+instance (Outputable name)
=> Outputable (DefaultDecl name) where
ppr (DefaultDecl tys src_loc)
CallConv
SrcLoc
-instance (NamedThing name, Outputable name)
+instance (Outputable name)
=> Outputable (ForeignDecl name) where
ppr (ForeignDecl nm imp_exp ty ext_name cconv src_loc)
[HsIdInfo name]
SrcLoc
-instance (NamedThing name, Outputable name) => Outputable (IfaceSig name) where
+instance (Outputable name) => Outputable (IfaceSig name) where
ppr (IfaceSig var ty _ _)
= hang (hsep [ppr var, dcolon])
4 (ppr ty)