-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
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
when in for loop #213
Comments
Personally, I don't like this transformation. Syntactically, the test gets substantial rightward drift even though the body is less indented. The intent is also less clear because the (I got caught by a logical mistake with a |
This is probably more helpful:
But I think @jackfirth wants to see an example in the wild before adding a rule. A very beneficial use case would be for code that tries to do |
I like this rule, since it unlocks further for loop simplifications. For example, that I'm sympathetic to the idea that |
I implemented this in #249 and forgot that this issue exists 😅 I implemented it because I hit a few loops in real-world code that this would simplify. It appears that complex condition expressions in |
Rewrites
to
The text was updated successfully, but these errors were encountered: