-
Notifications
You must be signed in to change notification settings - Fork 454
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
feat: extend if h:
hypothesis scope after early return
#5585
Conversation
Mathlib CI status (docs):
|
if: h
hypothesis scope after early return
if: h
hypothesis scope after early returnif h:
hypothesis scope after early return
I see the motivation, but I am worried about the implementation complexity. This would require an analysis that determines whether one branch or the other of an Ah, this is a PR, not an RFC. Sorry, I’m slighty sick… but it seems that your code misses for example cases where the then-branch is itself an |
This module is currently frozen pending a rewrite, so I'll close this PR. Please open an RFC prior to a PR to get feedback on whether a contribution is desired. |
Thanks for your replies. I think someone mentioned that this part of the code is frozen after I posted the PR. I wasn't really expecting for the code to get merged but for the purpose of a RFC, I started a discussion on Zulip (linked above) and used this PR as a "proof of concept" for the idea (including the tests to demonstrate its benefits) If this code is getting rewritten, please LMK if I can help at some point! |
Ideally yes but as I pointed out in the motivation & Zulip discussion, this doesn't seem to be the case, unfortunately, even in the source of Lean itself. (It's also sort of related to my RFC about |
You can mark PRs as drafts to avoid any confusion on this point :) |
Extend the scope of hypothesis
if h: ...
inside ofdo
notation after areturn
,continue
andbreak
. This PR makes it easier to work with "early return" code.The tests demonstrate the usefulness but here's a MWE:
Here's some discussion on Zulip and additional motivation in this RFC #5598