X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FbasicTypes%2FDataCon.lhs;h=c75f1b4fa431d43eece9ecd4d6b85c898f4a9183;hb=7d6dffe542bdad5707a929ae7ac25813c586766d;hp=d7a7e2ab94ad428428a8876ad2271365aa1e2b84;hpb=4330e6f4e8f9ad2b09a3f71828d586e829227eca;p=ghc-hetmet.git diff --git a/compiler/basicTypes/DataCon.lhs b/compiler/basicTypes/DataCon.lhs index d7a7e2a..c75f1b4 100644 --- a/compiler/basicTypes/DataCon.lhs +++ b/compiler/basicTypes/DataCon.lhs @@ -10,7 +10,7 @@ module DataCon ( ConTag, fIRST_TAG, mkDataCon, dataConRepType, dataConSig, dataConFullSig, - dataConName, dataConTag, dataConTyCon, dataConUserType, + dataConName, dataConIdentity, dataConTag, dataConTyCon, dataConUserType, dataConUnivTyVars, dataConExTyVars, dataConAllTyVars, dataConResTys, dataConEqSpec, eqSpecPreds, dataConTheta, dataConStupidTheta, dataConInstArgTys, dataConOrigArgTys, @@ -350,7 +350,7 @@ data DataConIds -- The 'Nothing' case of DCIds is important -- Not only is this efficient, -- but it also ensures that the wrapper is replaced - -- by the worker (becuase it *is* the wroker) + -- by the worker (becuase it *is* the worker) -- even when there are no args. E.g. in -- f (:) x -- the (:) *is* the worker. @@ -501,6 +501,19 @@ mk_dict_strict_mark pred | isStrictPred pred = MarkedStrict dataConName :: DataCon -> Name dataConName = dcName +-- generate a name in the format: package:Module.OccName +-- and the unique identity of the name +dataConIdentity :: DataCon -> String +dataConIdentity dataCon + = prettyName + where + prettyName = pretty packageModule ++ "." ++ pretty occ + nm = getName dataCon + packageModule = nameModule nm + occ = getOccName dataCon + pretty :: Outputable a => a -> String + pretty = showSDoc . ppr + dataConTag :: DataCon -> ConTag dataConTag = dcTag @@ -619,7 +632,7 @@ dataConUserType (MkData { dcUnivTyVars = univ_tvs, mkFunTys (mkPredTys theta) $ mkFunTys arg_tys $ case tyConFamInst_maybe tycon of - Nothing -> mkTyConApp tycon (map (substTyVar subst) univ_tvs) + Nothing -> mkTyConApp tycon (substTyVars subst univ_tvs) Just (ftc, insttys) -> mkTyConApp ftc insttys -- data instance where subst = mkTopTvSubst eq_spec