X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Fiface%2FBuildTyCl.lhs;h=bf71ca843ce8fa5158f27b326197aa2aa42341cb;hb=bb106f283663e9c16a4c72ec9ca57109ae57a0ed;hp=c669daf67cb656367f7839a29d6c66ef9b5b82fa;hpb=e8a591c1a3dbdeccec2dd2aacccd7435004b0d51;p=ghc-hetmet.git diff --git a/compiler/iface/BuildTyCl.lhs b/compiler/iface/BuildTyCl.lhs index c669daf..bf71ca8 100644 --- a/compiler/iface/BuildTyCl.lhs +++ b/compiler/iface/BuildTyCl.lhs @@ -37,6 +37,7 @@ import Type ( mkArrowKinds, liftedTypeKind, typeKind, splitTyConApp_maybe, splitAppTy_maybe, getTyVar_maybe, mkPredTys, mkTyVarTys, ThetaType, Type, Kind, + TyThing(..), substTyWith, zipTopTvSubst, substTheta, mkForAllTys, mkTyConApp, mkTyVarTy ) import Coercion ( mkNewTypeCoercion ) @@ -231,11 +232,12 @@ mkTyConSelIds tycon rhs \begin{code} buildClass :: Name -> [TyVar] -> ThetaType -> [FunDep TyVar] -- Functional dependencies + -> [TyThing] -- Associated types -> [(Name, DefMeth, Type)] -- Method info -> RecFlag -- Info for type constructor -> TcRnIf m n Class -buildClass class_name tvs sc_theta fds sig_stuff tc_isrec +buildClass class_name tvs sc_theta fds ats sig_stuff tc_isrec = do { tycon_name <- newImplicitBinder class_name mkClassTyConOcc ; datacon_name <- newImplicitBinder class_name mkClassDataConOcc -- The class name is the 'parent' for this datacon, not its tycon, @@ -285,10 +287,12 @@ buildClass class_name tvs sc_theta fds sig_stuff tc_isrec -- Because C has only one operation, it is represented by -- a newtype, and it should be a *recursive* newtype. -- [If we don't make it a recursive newtype, we'll expand the - -- newtype like a synonym, but that will lead to an infinite type] + -- newtype like a synonym, but that will lead to an infinite + -- type] + ; atTyCons = [tycon | ATyCon tycon <- ats] } - ; return (mkClass class_name tvs fds - sc_theta sc_sel_ids op_items + ; return (mkClass class_name tvs fds + sc_theta sc_sel_ids atTyCons op_items tycon) })} \end{code}