summaryrefslogtreecommitdiff
path: root/compiler/iface/BuildTyCl.lhs
diff options
context:
space:
mode:
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>2006-09-20 18:34:46 +0000
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>2006-09-20 18:34:46 +0000
commitbb106f283663e9c16a4c72ec9ca57109ae57a0ed (patch)
tree29ef06c7dabb92382ef8e84f79c61c991759fdbf /compiler/iface/BuildTyCl.lhs
parent229aaa59fd13e69778cb1ec809d065fa25b40a43 (diff)
downloadhaskell-bb106f283663e9c16a4c72ec9ca57109ae57a0ed.tar.gz
Extend Class.Class to include the TyCons of ATs
Mon Sep 18 18:58:51 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au> * Extend Class.Class to include the TyCons of ATs Wed Aug 16 16:15:31 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au> * Extend Class.Class to include the TyCons of ATs
Diffstat (limited to 'compiler/iface/BuildTyCl.lhs')
-rw-r--r--compiler/iface/BuildTyCl.lhs12
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/iface/BuildTyCl.lhs b/compiler/iface/BuildTyCl.lhs
index c669daf67c..bf71ca843c 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}