- = returnM (HsNumTy n, liftedTypeKind)
-
-kc_hs_type (HsKindSig ty k)
- = kcCheckHsType ty k `thenM` \ ty' ->
- returnM (HsKindSig ty' k, k)
-
-kc_hs_type (HsTupleTy Boxed tys)
- = mappM kcLiftedType tys `thenM` \ tys' ->
- returnM (HsTupleTy Boxed tys', liftedTypeKind)
-
-kc_hs_type (HsTupleTy Unboxed tys)
- = mappM kcTypeType tys `thenM` \ tys' ->
- returnM (HsTupleTy Unboxed tys', ubxTupleKind)
-
-kc_hs_type (HsFunTy ty1 ty2)
- = kcCheckHsType ty1 argTypeKind `thenM` \ ty1' ->
- kcTypeType ty2 `thenM` \ ty2' ->
- returnM (HsFunTy ty1' ty2', liftedTypeKind)
-
-kc_hs_type ty@(HsOpTy ty1 op ty2)
- = addLocM kcTyVar op `thenM` \ op_kind ->
- kcApps op_kind (ppr op) [ty1,ty2] `thenM` \ ([ty1',ty2'], res_kind) ->
- returnM (HsOpTy ty1' op ty2', res_kind)
-
-kc_hs_type ty@(HsAppTy ty1 ty2)
- = kcHsType fun_ty `thenM` \ (fun_ty', fun_kind) ->
- kcApps fun_kind (ppr fun_ty) arg_tys `thenM` \ ((arg_ty':arg_tys'), res_kind) ->
- returnM (foldl mk_app (HsAppTy fun_ty' arg_ty') arg_tys', res_kind)
+ = return (HsNumTy n, liftedTypeKind)
+
+kc_hs_type (HsKindSig ty k) = do
+ ty' <- kcCheckHsType ty k
+ return (HsKindSig ty' k, k)
+
+kc_hs_type (HsTupleTy Boxed tys) = do
+ tys' <- mapM kcLiftedType tys
+ return (HsTupleTy Boxed tys', liftedTypeKind)
+
+kc_hs_type (HsTupleTy Unboxed tys) = do
+ tys' <- mapM kcTypeType tys
+ return (HsTupleTy Unboxed tys', ubxTupleKind)
+
+kc_hs_type (HsFunTy ty1 ty2) = do
+ ty1' <- kcCheckHsType ty1 argTypeKind
+ ty2' <- kcTypeType ty2
+ return (HsFunTy ty1' ty2', liftedTypeKind)
+
+kc_hs_type ty@(HsOpTy ty1 op ty2) = do
+ op_kind <- addLocM kcTyVar op
+ ([ty1',ty2'], res_kind) <- kcApps op_kind (ppr op) [ty1,ty2]
+ return (HsOpTy ty1' op ty2', res_kind)
+
+kc_hs_type ty@(HsAppTy ty1 ty2) = do
+ (fun_ty', fun_kind) <- kcHsType fun_ty
+ ((arg_ty':arg_tys'), res_kind) <- kcApps fun_kind (ppr fun_ty) arg_tys
+ return (foldl mk_app (HsAppTy fun_ty' arg_ty') arg_tys', res_kind)