- hasTyVar (TyVarTy _) = True
- hasTyVar (FunTy a b) = hasTyVar a || hasTyVar b
- hasTyVar (NoteTy _ t) = hasTyVar t
- hasTyVar (AppTy a b) = hasTyVar a || hasTyVar b
- hasTyVar (TyConApp _ ts) = any hasTyVar ts
- hasTyVar _ = False
+ -- checks for tyvars and unlifted kinds.
+ isValidType (TyVarTy _) = False
+ isValidType (FunTy a b) = isValidType a && isValidType b
+ isValidType (NoteTy _ t) = isValidType t
+ isValidType (AppTy a b) = isValidType a && isValidType b
+ isValidType (TyConApp con ts) = not (isUnLiftedTyCon con) && all isValidType ts
+ isValidType _ = True