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

feat: allow EStateM to be used universe-polymorphically #3010

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

eric-wieser
Copy link
Contributor

@eric-wieser eric-wieser commented Dec 1, 2023

This doesn't change IO or ST (such a change would be more invasive and require approval of #3011), but does enable downstream projects like Mathlib to use EStateM for their own purposes with full universe polymorphism.
The alternative is defining an entire copy of EStateM, which is a lot of boilerplate.

The generalized EStateM.map after this change can be invoked (in the non-monadic spelling) with ULift.up to move between universes. Previously it was only universe-monomorphic.

There seems to be no cost associated behind this generalization, besides that one test of the new compiler has its log output reordered.

This doesn't change `IO` or `ST`, but does enable downstream projects like `Mathlib` to use `EStateM` for their own purposes with full universe polymorphism.

The alternative is defining an entire copy of EStateM, which is a lot of boilerplate.
@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 1, 2023
@leanprover-community-mathlib4-bot
Copy link
Collaborator

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

  • ❗ Mathlib CI will not be attempted unless you rebase your PR onto the 'nightly' branch. (2023-12-01 21:00:48)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 48711ce6ebefd6805b01c697703a8e6389e6b8cf --onto 0196bca784f82f90b4efd2a85a400daf4ab767f8. (2024-09-27 12:49:29)

@eric-wieser eric-wieser changed the title feat: allow EStateM to be used polymorphically feat: allow EStateM to be used universe-polymorphically Sep 28, 2024
@eric-wieser eric-wieser marked this pull request as ready for review September 28, 2024 13:49
@eric-wieser
Copy link
Contributor Author

Marking this as "ready-for-review", since it seems that some Lean change in the last 9 month remove any fallout this once had (perhaps it was just a case of stage0 being outdated at the time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

2 participants