- | isTrueLHsExpr e
- = matchGuards stmts ctx rhs rhs_ty
-
-matchGuards (ExprStmt expr _ _ : stmts) ctx rhs rhs_ty
- = matchGuards stmts ctx rhs rhs_ty `thenDs` \ match_result ->
- dsLExpr expr `thenDs` \ pred_expr ->
- returnDs (mkGuardedMatchResult pred_expr match_result)
-
-matchGuards (LetStmt binds : stmts) ctx rhs rhs_ty
- = matchGuards stmts ctx rhs rhs_ty `thenDs` \ match_result ->
- returnDs (adjustMatchResultDs (dsLocalBinds binds) match_result)
+ | Just addTicks <- isTrueLHsExpr e = do
+ match_result <- matchGuards stmts ctx rhs rhs_ty
+ return (adjustMatchResultDs addTicks match_result)
+matchGuards (ExprStmt expr _ _ : stmts) ctx rhs rhs_ty = do
+ match_result <- matchGuards stmts ctx rhs rhs_ty
+ pred_expr <- dsLExpr expr
+ return (mkGuardedMatchResult pred_expr match_result)
+
+matchGuards (LetStmt binds : stmts) ctx rhs rhs_ty = do
+ match_result <- matchGuards stmts ctx rhs rhs_ty
+ return (adjustMatchResultDs (dsLocalBinds binds) match_result)