Introduction
Match guards help you add extra checks to patterns in a match statement. They let you be more specific about when a pattern should be used.
You want to match a value only if it meets a certain condition, like being greater than 10.
You have multiple similar patterns but want to handle them differently based on extra rules.
You want to avoid writing nested if statements inside match arms.
You want clearer and cleaner code by combining pattern matching and conditions.
You want to check a variable's value and another condition at the same time.