classBigSig, classExtraBigSig, classTvsFds, classSCTheta
) where
+#include "Typeable.h"
+
import {-# SOURCE #-} TyCon ( TyCon )
import {-# SOURCE #-} TypeRep ( PredType )
import Name
import BasicTypes
import Unique
+import Util
import Outputable
import FastString
+
+import qualified Data.Data as Data
\end{code}
%************************************************************************
-- Default-method info
data DefMeth = NoDefMeth -- No default method
- | DefMeth -- A polymorphic default method
+ | DefMeth Name -- A polymorphic default method
| GenDefMeth -- A generic default method
deriving Eq
\end{code}
showsPrec p c = showsPrecSDoc p (ppr c)
instance Outputable DefMeth where
- ppr DefMeth = text "{- has default method -}"
- ppr GenDefMeth = text "{- has generic method -}"
+ ppr (DefMeth n) = ptext (sLit "Default method") <+> ppr n
+ ppr GenDefMeth = ptext (sLit "Generic default method")
ppr NoDefMeth = empty -- No default method
pprFundeps :: Outputable a => [FunDep a] -> SDoc
pprFunDep :: Outputable a => FunDep a -> SDoc
pprFunDep (us, vs) = hsep [interppSP us, ptext (sLit "->"), interppSP vs]
+
+instance Data.Typeable Class where
+ typeOf _ = Data.mkTyConApp (Data.mkTyCon "Class") []
+
+instance Data.Data Class where
+ -- don't traverse?
+ toConstr _ = abstractConstr "Class"
+ gunfold _ _ = error "gunfold"
+ dataTypeOf _ = mkNoRepType "Class"
\end{code}