- tcRuleBndrs vars (\ ids ->
- -- Now LHS and RHS
- getLIE (tcMonoExpr lhs rule_ty) `thenM` \ (lhs', lhs_lie) ->
- getLIE (tcMonoExpr rhs rule_ty) `thenM` \ (rhs', rhs_lie) ->
- returnM (ids, lhs', rhs', lhs_lie, rhs_lie)
- ) `thenM` \ (ids, lhs', rhs', lhs_lie, rhs_lie) ->
+ (ids, lhs', rhs', lhs_lie, rhs_lie, rule_ty) <-
+ tcRuleBndrs vars $ \ ids -> do
+ -- Now LHS and RHS; see Note [Typechecking rules]
+ ((lhs', rule_ty), lhs_lie) <- getLIE (tcInferRho lhs)
+ (rhs', rhs_lie) <- getLIE (tcMonoExpr rhs rule_ty)
+ return (ids, lhs', rhs', lhs_lie, rhs_lie, rule_ty)