We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if
case
What the rule should do: Infer the value from a simple case statement to use it to simplify if expressions
What problems does it solve: It helps during refactorings, especially when switching from if to case, and copying the old content inside branches
Example of things the rule would report:
case category of "Rock" -> if category == "Rock" then a else b --> case category of "Rock" -> a
Should this be part of the Simplify rule or should it be a new rule? Part of simplify. It ties into the inference code.
I am looking for:
The text was updated successfully, but these errors were encountered:
We should also handle the opposite, when the case expression is inside the if:
if category == "Rock" then case category of "Rock" -> 1 _ -> 2 else 3 --> if category == "Rock" then 1 else 3
Sorry, something went wrong.
No branches or pull requests
What the rule should do:
Infer the value from a simple
case
statement to use it to simplifyif
expressionsWhat problems does it solve:
It helps during refactorings, especially when switching from
if
tocase
, and copying the old content inside branchesExample of things the rule would report:
Should this be part of the Simplify rule or should it be a new rule?
Part of simplify. It ties into the inference code.
I am looking for:
The text was updated successfully, but these errors were encountered: