X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fprelude%2FTysWiredIn.lhs;h=e420d7bd0607b624dab287ec58ce4f06439c802c;hp=bc450281991faa8dd930730b9c8baceea1e3fa33;hb=9241ac84d10f7e6b23841da2c0765275072ad7c1;hpb=f22c873e99d5b371a03d249febb89195a4fda2fc diff --git a/compiler/prelude/TysWiredIn.lhs b/compiler/prelude/TysWiredIn.lhs index bc45028..e420d7b 100644 --- a/compiler/prelude/TysWiredIn.lhs +++ b/compiler/prelude/TysWiredIn.lhs @@ -50,9 +50,16 @@ module TysWiredIn ( -- * Heterogeneous Metaprogramming mkHetMetCodeTypeTy, hetMetCodeTypeTyConName, - hetMetCodeTypeTyCon, isHetMetCodeTypeTyCon, + hetMetCodeTypeTyCon, + isHetMetCodeTypeTyCon, hetMetCodeTypeTyCon_RDR, + mkHetMetKappaTy, + hetMetKappaTyConName, + hetMetKappaTyCon, + hetMetKappaTyCon_RDR, + isHetMetKappaTyCon, + -- * Parallel arrays mkPArrTy, parrTyCon, parrFakeCon, isPArrTyCon, isPArrFakeCon, @@ -122,6 +129,7 @@ wiredInTyCons = [ unitTyCon -- Not treated like other tuples, because , listTyCon , parrTyCon , hetMetCodeTypeTyCon + , hetMetKappaTyCon ] \end{code} @@ -172,8 +180,12 @@ hetMetCodeTypeDataConName :: Name hetMetCodeTypeDataConName = mkWiredInDataConName BuiltInSyntax gHC_HETMET_CODETYPES (fsLit "<[]>") hetMetCodeTypeDataConKey hetMetCodeTypeDataCon +hetMetKappaTyConName :: Name +hetMetKappaTyConName = mkWiredInTyConName BuiltInSyntax gHC_HETMET_CODETYPES (fsLit "~~>") hetMetKappaTyConKey hetMetKappaTyCon + boolTyCon_RDR, false_RDR, true_RDR, intTyCon_RDR, charTyCon_RDR, - intDataCon_RDR, listTyCon_RDR, consDataCon_RDR, parrTyCon_RDR, hetMetCodeTypeTyCon_RDR :: RdrName + intDataCon_RDR, listTyCon_RDR, consDataCon_RDR, parrTyCon_RDR, hetMetCodeTypeTyCon_RDR, + hetMetKappaTyCon_RDR :: RdrName boolTyCon_RDR = nameRdrName boolTyConName false_RDR = nameRdrName falseDataConName true_RDR = nameRdrName trueDataConName @@ -184,6 +196,7 @@ listTyCon_RDR = nameRdrName listTyConName consDataCon_RDR = nameRdrName consDataConName parrTyCon_RDR = nameRdrName parrTyConName hetMetCodeTypeTyCon_RDR = nameRdrName hetMetCodeTypeTyConName +hetMetKappaTyCon_RDR = nameRdrName hetMetKappaTyConName \end{code} @@ -614,16 +627,25 @@ Heterogeneous Metaprogramming mkHetMetCodeTypeTy :: TyVar -> Type -> Type mkHetMetCodeTypeTy ecn ty = mkTyConApp hetMetCodeTypeTyCon [(mkTyVarTy ecn), ty] +mkHetMetKappaTy :: Type -> Type -> Type +mkHetMetKappaTy a b = mkTyConApp hetMetKappaTyCon [a, b] + ecTyVar = head ecTyVars -- | Represents the type constructor of box types hetMetCodeTypeTyCon :: TyCon hetMetCodeTypeTyCon = pcNonRecDataTyCon hetMetCodeTypeTyConName [ecTyVar, betaTyVar] [hetMetCodeTypeDataCon] +hetMetKappaTyCon :: TyCon +hetMetKappaTyCon = pcNonRecDataTyCon hetMetKappaTyConName [alphaTyVar, betaTyVar] [] + -- | Check whether a type constructor is the constructor for box types isHetMetCodeTypeTyCon :: TyCon -> Bool isHetMetCodeTypeTyCon tc = tyConName tc == hetMetCodeTypeTyConName +isHetMetKappaTyCon :: TyCon -> Bool +isHetMetKappaTyCon tc = tyConName tc == hetMetKappaTyConName + hetMetCodeTypeDataCon :: DataCon hetMetCodeTypeDataCon = pcDataCon hetMetCodeTypeDataConName