module DDC.Core.Lite.Compounds
( tBoolU, tBool
, tNatU, tNat, dcNatU, xNatU
, tIntU, tInt
, tWordU
, tPair
, tList)
where
import DDC.Core.Lite.Name
import DDC.Core.Compounds
import DDC.Core.Exp
tBool :: Region Name -> Type Name
tBool r1
= TApp (TCon tcBool) r1
where tcBool = TyConBound (UPrim (NameDataTyCon DataTyConBool) kBool) kBool
kBool = kFun kRegion kData
tBoolU :: Type Name
tBoolU = TCon (TyConBound (UPrim (NamePrimTyCon PrimTyConBool) kData) kData)
tNatU :: Type Name
tNatU = TCon (TyConBound (UPrim (NamePrimTyCon PrimTyConNat) kData) kData)
dcNatU :: Integer -> DaCon Name
dcNatU i = DaConPrim (NameLitNat i) tNatU
xNatU :: a -> Integer -> Exp a Name
xNatU a i = XCon a (dcNatU i)
tNat :: Region Name -> Type Name
tNat r1
= TApp (TCon tcNat) r1
where tcNat = TyConBound (UPrim (NameDataTyCon DataTyConNat) kNat) kNat
kNat = kFun kRegion kData
tIntU :: Type Name
tIntU = TCon (TyConBound (UPrim (NamePrimTyCon PrimTyConInt) kData) kData)
tInt :: Region Name -> Type Name
tInt r1
= TApp (TCon tcInt) r1
where tcInt = TyConBound (UPrim (NameDataTyCon DataTyConInt) kInt) kInt
kInt = kFun kRegion kData
tWordU :: Int -> Type Name
tWordU bits
= TCon (TyConBound (UPrim (NamePrimTyCon (PrimTyConWord bits)) kData) kData)
tPair :: Region Name -> Type Name -> Type Name -> Type Name
tPair tR tA tB
= tApps (TCon tcPair) [tR, tA, tB]
where tcPair = TyConBound (UPrim (NameDataTyCon DataTyConPair) kPair) kPair
kPair = kFuns [kRegion, kData, kData] kData
tList :: Region Name -> Type Name -> Type Name
tList tR tA
= tApps (TCon tcList) [tR, tA]
where tcList = TyConBound (UPrim (NameDataTyCon DataTyConList) kList) kList
kList = kRegion `kFun` kData `kFun` kData