- = tcBindsAndThen glueBindsOnGRHSs binds $
- do { grhss' <- mappM (wrapLocM tc_grhs) grhss
- ; return (GRHSs grhss' []) }
-
- stmt_ctxt = SC { sc_what = PatGuard match_ctxt,
- sc_rhs = tcInferRho,
- sc_body = \ body -> tcCmd env body (stk', res_ty),
- sc_ty = res_ty } -- ToDo: Is this right?
- tc_grhs (GRHS guarded)
- = do { guarded' <- tcStmts stmt_ctxt guarded
- ; return (GRHS guarded') }
+ = do { (binds', grhss') <- tcLocalBinds binds $
+ mappM (wrapLocM tc_grhs) grhss
+ ; return (GRHSs grhss' binds') }
+
+ tc_grhs (GRHS guards body)
+ = do { (guards', rhs') <- tcStmts pg_ctxt
+ (tcGuardStmt res_ty)
+ guards
+ (tcCmd env body (stk', res_ty))
+ ; return (GRHS guards' rhs') }