typeCon, -- :: BX -> KX
liftedTypeKind, unliftedTypeKind, openTypeKind, -- :: KX
mkArrowKind, mkArrowKinds, -- :: KX -> KX -> KX
-
+ isTypeKind,
funTyCon,
usageKindCon, -- :: KX
-- Used when generalising: default kind '?' to '*'
defaultKind kind | kind `eqKind` openTypeKind = liftedTypeKind
| otherwise = kind
+
+isTypeKind :: Kind -> Bool
+-- True of kind * and *#
+isTypeKind k = case splitTyConApp_maybe k of
+ Just (tc,[k]) -> tc == typeCon
+ other -> False
\end{code}
\begin{code}
mkTyConApp :: TyCon -> [Type] -> Type
+-- Assumes TyCon is not a SynTyCon; use mkSynTy instead for those
mkTyConApp tycon tys
| isFunTyCon tycon, [ty1,ty2] <- tys
= FunTy (mkUTyM ty1) (mkUTyM ty2)