summaryrefslogtreecommitdiff
path: root/compiler/prelude/TysPrim.lhs
diff options
context:
space:
mode:
authorIavor S. Diatchki <iavor.diatchki@gmail.com>2011-12-18 17:21:13 -0800
committerIavor S. Diatchki <iavor.diatchki@gmail.com>2011-12-18 17:24:45 -0800
commit7c2af5cb6454ef219e2b35bc24d80624be07d2de (patch)
tree10e7c33455b58b35d1fc2d8d61b6c714c216dcb8 /compiler/prelude/TysPrim.lhs
parent826b75a9a4fc6e978a4cfa09d896a927c56cfb75 (diff)
downloadhaskell-7c2af5cb6454ef219e2b35bc24d80624be07d2de.tar.gz
Extend GHC's type with a representation for type level literals.
Currently, we support only numeric literals but---hopefully---these modifications should make it fairly easy to add other ones, if necessary.
Diffstat (limited to 'compiler/prelude/TysPrim.lhs')
-rw-r--r--compiler/prelude/TysPrim.lhs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/prelude/TysPrim.lhs b/compiler/prelude/TysPrim.lhs
index a3c2c6bb83..911402c59b 100644
--- a/compiler/prelude/TysPrim.lhs
+++ b/compiler/prelude/TysPrim.lhs
@@ -38,6 +38,7 @@ module TysPrim(
anyKind, liftedTypeKind, unliftedTypeKind, openTypeKind,
argTypeKind, ubxTupleKind, constraintKind,
mkArrowKind, mkArrowKinds,
+ typeNatKind,
funTyCon, funTyConName,
primTyCons,
@@ -341,6 +342,11 @@ argTypeKind = kindTyConType argTypeKindTyCon
ubxTupleKind = kindTyConType ubxTupleKindTyCon
constraintKind = kindTyConType constraintKindTyCon
+ -- XXX: we should probably be using a different type than Word here...
+typeNatKind :: Kind
+typeNatKind = kindTyConType (mkKindTyCon wordTyConName tySuperKind)
+
+
-- | Given two kinds @k1@ and @k2@, creates the 'Kind' @k1 -> k2@
mkArrowKind :: Kind -> Kind -> Kind
mkArrowKind k1 k2 = FunTy k1 k2