- let
- tc_stmts [] = returnTc (([], error "tc_stmts"), emptyLIE)
- tc_stmts (stmt:stmts) = tcStmt do_or_lc (mkAppTy m) combine_stmts stmt $
- tc_stmts stmts
-
- combine_stmts stmt@(ReturnStmt _) (Just ty) ([], _) = ([stmt], ty)
- combine_stmts stmt@(ExprStmt e _) (Just ty) ([], _) = ([stmt], ty)
- combine_stmts stmt _ ([], _) = panic "Bad last stmt tcDoStmts"
- combine_stmts stmt _ (stmts, ty) = (stmt:stmts, ty)
- in
- tc_stmts stmts `thenTc` \ ((stmts', result_ty), final_lie) ->
- unifyTauTy res_ty result_ty `thenTc_`
+ newTyVarTy (mkArrowKind boxedTypeKind boxedTypeKind) `thenNF_Tc` \ m ->
+ newTyVarTy boxedTypeKind `thenNF_Tc` \ elt_ty ->
+ unifyTauTy res_ty (mkAppTy m elt_ty) `thenTc_`
+
+ tcStmts do_or_lc (mkAppTy m) stmts elt_ty `thenTc` \ (stmts', stmts_lie) ->