-
Notifications
You must be signed in to change notification settings - Fork 459
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: upstream ToLevel
from mathlib
#6285
Conversation
Mathlib CI status (docs):
|
awaiting-review |
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.
Thanks! Just a few comments.
Co-authored-by: Kyle Miller <kmill31415@gmail.com>
@kmill All comments addressed! awaiting-review |
CI seems to be unhappy about a bunch of files that should use prelude; I didn't touch any of those files in this PR, though, so I assume that's safe to ignore? |
Would you mind merging/rebasing the master branch? I think there could be differences in the CI scripts causing an issue. |
(Thanks @tobiasgrosser, merging master worked!) I just put this on the merge queue. Looking forward to the next PR @alexkeizer. |
@alexkeizer, @kmill, it would have been good to get a test against Mathlib before we merged this. There were some changes required in Mathlib to adapt. |
Sorry for that! What's the proper workflow for testing things against Mathlib? Should I base the next PR off of |
Yes, that's it! |
This PR adds a deriving handler for the `ToExpr` class. It can handle mutual and nested inductive types, however it falls back to creating `partial` instances in such cases. This is upstreamed from the Mathlib deriving handler written by @kmill, but has fixes to handle autoimplicit universe level variables. This is a followup to #6285 (adding the `ToLevel` class). This PR supersedes #5906. Co-authored-by: Alex Keizer <alex@keizer.dev> --------- Co-authored-by: Alex Keizer <alex@keizer.dev>
This PR adds a deriving handler for the `ToExpr` class. It can handle mutual and nested inductive types, however it falls back to creating `partial` instances in such cases. This is upstreamed from the Mathlib deriving handler written by @kmill, but has fixes to handle autoimplicit universe level variables. This is a followup to leanprover#6285 (adding the `ToLevel` class). This PR supersedes leanprover#5906. Co-authored-by: Alex Keizer <alex@keizer.dev> --------- Co-authored-by: Alex Keizer <alex@keizer.dev>
This PR upstreams the `ToLevel` typeclass from mathlib and uses it to fix the existing `ToExpr` instances so that they are truly universe polymorphic (previously it generated malformed expressions when the universe level was nonzero). We improve on the mathlib definition of `ToLevel` to ensure the class always lives in `Type`, irrespective of the universe parameter. This implements part one of the plan to upstream a derive handler for `ToExpr`, as discussed in leanprover#5906 and leanprover#5909. --------- Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: Tobias Grosser <tobias@grosser.es>
This PR adds a deriving handler for the `ToExpr` class. It can handle mutual and nested inductive types, however it falls back to creating `partial` instances in such cases. This is upstreamed from the Mathlib deriving handler written by @kmill, but has fixes to handle autoimplicit universe level variables. This is a followup to leanprover#6285 (adding the `ToLevel` class). This PR supersedes leanprover#5906. Co-authored-by: Alex Keizer <alex@keizer.dev> --------- Co-authored-by: Alex Keizer <alex@keizer.dev>
This PR upstreams the
ToLevel
typeclass from mathlib and uses it to fix the existingToExpr
instances so that they are truly universe polymorphic (previously it generated malformed expressions when the universe level was nonzero). We improve on the mathlib definition ofToLevel
to ensure the class always lives inType
, irrespective of the universe parameter.This implements part one of the plan to upstream a derive handler for
ToExpr
, as discussed in #5906 and #5909.