projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add support for <{..}> and ~~> syntax as well as typing for Kappa-calculus
[ghc-hetmet.git]
/
compiler
/
prelude
/
TysWiredIn.lhs
diff --git
a/compiler/prelude/TysWiredIn.lhs
b/compiler/prelude/TysWiredIn.lhs
index
bc45028
..
e420d7b
100644
(file)
--- a/
compiler/prelude/TysWiredIn.lhs
+++ b/
compiler/prelude/TysWiredIn.lhs
@@
-50,9
+50,16
@@
module TysWiredIn (
-- * Heterogeneous Metaprogramming
mkHetMetCodeTypeTy,
hetMetCodeTypeTyConName,
-- * Heterogeneous Metaprogramming
mkHetMetCodeTypeTy,
hetMetCodeTypeTyConName,
- hetMetCodeTypeTyCon, isHetMetCodeTypeTyCon,
+ hetMetCodeTypeTyCon,
+ isHetMetCodeTypeTyCon,
hetMetCodeTypeTyCon_RDR,
hetMetCodeTypeTyCon_RDR,
+ mkHetMetKappaTy,
+ hetMetKappaTyConName,
+ hetMetKappaTyCon,
+ hetMetKappaTyCon_RDR,
+ isHetMetKappaTyCon,
+
-- * Parallel arrays
mkPArrTy,
parrTyCon, parrFakeCon, isPArrTyCon, isPArrFakeCon,
-- * Parallel arrays
mkPArrTy,
parrTyCon, parrFakeCon, isPArrTyCon, isPArrFakeCon,
@@
-122,6
+129,7
@@
wiredInTyCons = [ unitTyCon -- Not treated like other tuples, because
, listTyCon
, parrTyCon
, hetMetCodeTypeTyCon
, listTyCon
, parrTyCon
, hetMetCodeTypeTyCon
+ , hetMetKappaTyCon
]
\end{code}
]
\end{code}
@@
-172,8
+180,12
@@
hetMetCodeTypeDataConName :: Name
hetMetCodeTypeDataConName =
mkWiredInDataConName BuiltInSyntax gHC_HETMET_CODETYPES (fsLit "<[]>") hetMetCodeTypeDataConKey hetMetCodeTypeDataCon
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,
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
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
consDataCon_RDR = nameRdrName consDataConName
parrTyCon_RDR = nameRdrName parrTyConName
hetMetCodeTypeTyCon_RDR = nameRdrName hetMetCodeTypeTyConName
+hetMetKappaTyCon_RDR = nameRdrName hetMetKappaTyConName
\end{code}
\end{code}
@@
-614,16
+627,25
@@
Heterogeneous Metaprogramming
mkHetMetCodeTypeTy :: TyVar -> Type -> Type
mkHetMetCodeTypeTy ecn ty = mkTyConApp hetMetCodeTypeTyCon [(mkTyVarTy ecn), ty]
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]
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
-- | 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
hetMetCodeTypeDataCon :: DataCon
hetMetCodeTypeDataCon = pcDataCon
hetMetCodeTypeDataConName