X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypes%2FCoercion.lhs;h=49ae740c7009ce6a7a09101099b086aec8dfa808;hb=ff8e1d01524b48e028b09e2b04b2e5303cb6d95f;hp=b9c6ea7fae77733d6c7c9b14454615e8ec1ee315;hpb=77241a03e4c0c56b35c63a303b96933232ecd083;p=ghc-hetmet.git diff --git a/compiler/types/Coercion.lhs b/compiler/types/Coercion.lhs index b9c6ea7..49ae740 100644 --- a/compiler/types/Coercion.lhs +++ b/compiler/types/Coercion.lhs @@ -25,7 +25,7 @@ module Coercion ( mkSymCoercion, mkTransCoercion, mkLeftCoercion, mkRightCoercion, mkInstCoercion, mkAppCoercion, mkForAllCoercion, mkFunCoercion, mkInstsCoercion, mkUnsafeCoercion, - mkNewTypeCoercion, mkDataInstCoercion, mkAppsCoercion, + mkNewTypeCoercion, mkFamInstCoercion, mkAppsCoercion, splitNewTypeRepCo_maybe, decomposeCo, @@ -294,18 +294,18 @@ mkNewTypeCoercion name tycon tvs rhs_ty rule args = ASSERT( co_con_arity == length args ) (TyConApp tycon args, substTyWith tvs args rhs_ty) --- Coercion identifying a data/newtype representation type and its family --- instance. It has the form `Co tvs :: F ts :=: R tvs', where `Co' is the --- coercion tycon built here, `F' the family tycon and `R' the (derived) +-- Coercion identifying a data/newtype/synonym representation type and its +-- family instance. It has the form `Co tvs :: F ts :=: R tvs', where `Co' is +-- the coercion tycon built here, `F' the family tycon and `R' the (derived) -- representation tycon. -- -mkDataInstCoercion :: Name -- unique name for the coercion tycon - -> [TyVar] -- type parameters of the coercion (`tvs') - -> TyCon -- family tycon (`F') - -> [Type] -- type instance (`ts') - -> TyCon -- representation tycon (`R') - -> TyCon -- => coercion tycon (`Co') -mkDataInstCoercion name tvs family instTys rep_tycon +mkFamInstCoercion :: Name -- unique name for the coercion tycon + -> [TyVar] -- type parameters of the coercion (`tvs') + -> TyCon -- family tycon (`F') + -> [Type] -- type instance (`ts') + -> TyCon -- representation tycon (`R') + -> TyCon -- => coercion tycon (`Co') +mkFamInstCoercion name tvs family instTys rep_tycon = mkCoercionTyCon name coArity rule where coArity = length tvs