Skip to content
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

fix: Option.getD eagerly evaluates dflt #3043

Merged
merged 2 commits into from
Dec 11, 2023
Merged

Conversation

digama0
Copy link
Collaborator

@digama0 digama0 commented Dec 9, 2023

Reported on Zulip. The dflt argument of Option.getD is not evaluated lazily, as the documentation says, because even after macro_inline the expression

match opt, dflt with
| some x, _ => x
| none, e => e

still has the semantics of evaluating dflt when opt is some x.

@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Dec 9, 2023
@leanprover-community-mathlib4-bot
Copy link
Collaborator

leanprover-community-mathlib4-bot commented Dec 9, 2023

  • ❗ Mathlib CI can not be attempted yet, as the 'nightly-testing-2023-12-09' branch does not exist there yet. We will retry when you push more commits. It may be necessary to rebase onto 'nightly' tomorrow. (2023-12-09 08:22:32)
  • ✅ Mathlib branch lean-pr-testing-3043 has successfully built against this PR. (2023-12-09 22:03:04) View Log
  • ✅ Mathlib branch lean-pr-testing-3043 has successfully built against this PR. (2023-12-09 22:40:51) View Log

@Kha
Copy link
Member

Kha commented Dec 9, 2023

!bench

tests/lean/run/optionGetD.lean Outdated Show resolved Hide resolved
@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit f9b7a28.
There were no significant changes against commit 00359a0.

leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Dec 9, 2023
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Dec 9, 2023
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Dec 9, 2023
@Kha Kha enabled auto-merge December 11, 2023 10:07
@Kha Kha added this pull request to the merge queue Dec 11, 2023
Merged via the queue into leanprover:master with commit 178ab8e Dec 11, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds-mathlib CI has verified that Mathlib builds against this PR toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants