= maybeParen (ctxt_prec >= pREC_CON)
(hsep [ppr_mono_ty pREC_FUN fun_ty, ppr_mono_ty pREC_CON arg_ty])
+ppr_mono_ty ctxt_prec (MonoIParamTy n ty)
+ = hsep [{- char '?' <> -} ppr n, text "::", ppr_mono_ty pREC_TOP ty]
+
ppr_mono_ty ctxt_prec (MonoDictTy clas tys)
= ppr clas <+> hsep (map (ppr_mono_ty pREC_CON) tys)
get (MonoTupleTy tys boxed) = unitNameSet (tupleTyCon_name boxed (length tys))
`unionNameSets` extractHsTyNames_s tys
get (MonoFunTy ty1 ty2) = get ty1 `unionNameSets` get ty2
+ get (MonoIParamTy n ty) = get ty
get (MonoDictTy cls tys) = unitNameSet cls `unionNameSets` extractHsTyNames_s tys
get (MonoUsgForAllTy uv ty) = get ty
get (MonoUsgTy u ty) = get ty
rnHsType doc ty2 `thenRn` \ (ty2', fvs2) ->
returnRn (MonoTyApp ty1' ty2', fvs1 `plusFV` fvs2)
+rnHsType doc (MonoIParamTy n ty)
+ = getIPName n `thenRn` \ name ->
+ rnHsType doc ty `thenRn` \ (ty', fvs) ->
+ returnRn (MonoIParamTy name ty', fvs)
+
rnHsType doc (MonoDictTy clas tys)
= lookupOccRn clas `thenRn` \ clas' ->
rnHsTypes doc tys `thenRn` \ (tys', fvs) ->
import Type ( Type, PredType(..), ThetaType, UsageAnn(..),
mkTyVarTy, mkTyVarTys, mkFunTy, mkSynTy, mkUsgTy,
mkUsForAllTy, zipFunTys,
- mkSigmaTy, mkDictTy, mkTyConApp, mkAppTys, splitForAllTys, splitRhoTy,
+ mkSigmaTy, mkDictTy, mkPredTy, mkTyConApp,
+ mkAppTys, splitForAllTys, splitRhoTy,
boxedTypeKind, unboxedTypeKind, tyVarsOfType,
mkArrowKinds, getTyVar_maybe, getTyVar,
tidyOpenType, tidyOpenTypes, tidyTyVar,
tc_type_kind :: RenamedHsType -> TcM s (TcKind, Type)
tc_type_kind ty@(MonoTyVar name)
= tc_app ty []
-
+
tc_type_kind (MonoListTy ty)
= tc_boxed_type ty `thenTc` \ tau_ty ->
returnTc (boxedTypeKind, mkListTy tau_ty)
tc_type_kind (MonoTyApp ty1 ty2)
= tc_app ty1 [ty2]
+tc_type_kind (MonoIParamTy n ty)
+ = tc_type ty `thenTc` \ tau ->
+ returnTc (boxedTypeKind, mkPredTy (IParam n tau))
+
tc_type_kind (MonoDictTy class_name tys)
= tcClassAssertion (HsPClass class_name tys) `thenTc` \ (Class clas arg_tys) ->
returnTc (boxedTypeKind, mkDictTy clas arg_tys)