\begin{code}
module Kind (
Kind(..), SimpleKind,
- openTypeKind, liftedTypeKind, unliftedTypeKind,
+ openTypeKind, liftedTypeKind, unliftedTypeKind, unboxedTypeKind,
argTypeKind, ubxTupleKind,
- isLiftedTypeKind, isUnliftedTypeKind,
+ isLiftedTypeKind, isUnliftedTypeKind, isUnliftedBoxedTypeKind,
isArgTypeKind, isOpenTypeKind,
mkArrowKind, mkArrowKinds,
/ \
/ \
?? (#)
- / \
- * #
+ / | \
+ * ! #
where * [LiftedTypeKind] means boxed type
- # [UnliftedTypeKind] means unboxed type
+ # [UnboxedTypeKind] means unboxed type
(#) [UbxTupleKind] means unboxed tuple
?? [ArgTypeKind] is the lub of *,#
? [OpenTypeKind] means any type at all
\begin{code}
data Kind
= LiftedTypeKind -- *
- | OpenTypeKind -- ?
- | UnliftedTypeKind -- #
- | UbxTupleKind -- (##)
- | ArgTypeKind -- ??
- | FunKind Kind Kind -- k1 -> k2
+ | OpenTypeKind -- ?
+ | UnboxedTypeKind -- #
+ | UnliftedTypeKind -- !
+ | UbxTupleKind -- (##)
+ | ArgTypeKind -- ??
+ | FunKind Kind Kind -- k1 -> k2
| KindVar KindVar
deriving( Eq )
\begin{code}
liftedTypeKind = LiftedTypeKind
+unboxedTypeKind = UnboxedTypeKind
unliftedTypeKind = UnliftedTypeKind
openTypeKind = OpenTypeKind
argTypeKind = ArgTypeKind
isLiftedTypeKind LiftedTypeKind = True
isLiftedTypeKind other = False
+isUnliftedBoxedTypeKind UnliftedTypeKind = True
+isUnliftedBoxedTypeKind other = False
+
isUnliftedTypeKind UnliftedTypeKind = True
+isUnliftedTypeKind UnboxedTypeKind = True
isUnliftedTypeKind other = False
isArgTypeKind :: Kind -> Bool
-- True of any sub-kind of ArgTypeKind
isArgTypeKind LiftedTypeKind = True
isArgTypeKind UnliftedTypeKind = True
+isArgTypeKind UnboxedTypeKind = True
isArgTypeKind ArgTypeKind = True
isArgTypeKind other = False
-- (k1 `isSubKind` k2) checks that k1 <: k2
isSubKind LiftedTypeKind LiftedTypeKind = True
isSubKind UnliftedTypeKind UnliftedTypeKind = True
+isSubKind UnboxedTypeKind UnboxedTypeKind = True
isSubKind UbxTupleKind UbxTupleKind = True
isSubKind k1 OpenTypeKind = isOpenTypeKind k1
isSubKind k1 ArgTypeKind = isArgTypeKind k1
pprKind (KindVar v) = ppr v
pprKind LiftedTypeKind = ptext SLIT("*")
-pprKind UnliftedTypeKind = ptext SLIT("#")
+pprKind UnliftedTypeKind = ptext SLIT("!")
+pprKind UnboxedTypeKind = ptext SLIT("#")
pprKind OpenTypeKind = ptext SLIT("?")
pprKind ArgTypeKind = ptext SLIT("??")
pprKind UbxTupleKind = ptext SLIT("(#)")