tyConDataCons, mkForeignTyCon, isProductTyCon,
isRecursiveTyCon, isOpenTyCon,
tyConStupidTheta, synTyConRhs, isSynTyCon, tyConName,
- isNewTyCon )
+ isNewTyCon, tyConKind )
import DataCon ( DataCon, dataConUserType, dataConName,
dataConFieldLabels, dataConTyCon, dataConAllTyVars,
dataConFieldType, dataConResTys )
kcIdxTyPats decl thing_inside
= kcHsTyVars (tcdTyVars decl) $ \tvs ->
do { tc_ty_thing <- tcLookupLocated (tcdLName decl)
- ; let tc_kind = case tc_ty_thing of { AThing k -> k }
- (kinds, resKind) = splitKindFunTys tc_kind
- hs_typats = fromJust $ tcdTyPats decl
+ ; let { tc_kind = case tc_ty_thing of
+ AGlobal (ATyCon tycon) -> tyConKind tycon
+ ; (kinds, resKind) = splitKindFunTys tc_kind
+ ; hs_typats = fromJust $ tcdTyPats decl }
-- we may not have more parameters than the kind indicates
; checkTc (length kinds >= length hs_typats) $
; typats <- zipWithM kcCheckHsType hs_typats kinds
; thing_inside tvs typats resultKind
}
+ where
\end{code}