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
[Merged by Bors] - feat(data/list): accessing list with fallback #15138
Conversation
Also prove some things about `list.inth` on the way. On the way to computable list-based polynomials
Move lemmas into `list/basic`
@@ -382,6 +382,9 @@ theorem iget_mem [inhabited α] : ∀ {o : option α}, is_some o → o.iget ∈ | |||
theorem iget_of_mem [inhabited α] {a : α} : ∀ {o : option α}, a ∈ o → o.iget = a | |||
| _ rfl := rfl | |||
|
|||
lemma get_or_else_default_eq_iget [inhabited α] (o : option α) : o.get_or_else default = o.iget := |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea for the future: redefine option.iget
as o.get_or_else default
.
Is there a description of the project (computable polynomials) goals and design decisions? Will it be a new type or you're going to redefine |
Anyway, this change LGTM. Thanks! |
Reimplement `list.inth` in terms of the new `list.nthd`. Implementation wise, it is "faster" because it doesn't have to go through `option.iget` on the way anymore. On the way to computable list-based polynomials
Maybe |
Pull request successfully merged into master. Build succeeded: |
Reimplement `list.inth` in terms of the new `list.nthd`. Implementation wise, it is "faster" because it doesn't have to go through `option.iget` on the way anymore. On the way to computable list-based polynomials
Reimplement
list.inth
in terms of the newlist.nthd
. Implementation wise, it is "faster" because it doesn't have to go throughoption.iget
on the way anymore.On the way to computable list-based polynomials