-
Notifications
You must be signed in to change notification settings - Fork 9
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
Universe polymorphism edits #151
Comments
Comment by antalsz Sounds like a good plan. I'd recommend |
Comment by antalsz Actually, another thought: should we always enable universe polymorphism and/or cumulativity? What would be the ramifications of that? (With |
Comment by lastland
That is a good question. I have been trying to modify |
Comment by lastland
Good suggestions! Thanks! |
Comment by lastland
BTW, the first use case can now be simulated by adding |
Comment by antalsz Ah, good point about the preamble. We could also switch to default polymorphic/edits for monomorphism, but it seems like there's no reason to do that – polymorphism seems to be less necessary. |
Comment by lastland
And my plan is to try to understand this part better :) |
Comment by lastland I have just found another term called "template universe polymorphic". It happened when you define something with explicit universe levels but without the keyword "Polymorphic" in front of the definition. This might also be something we want. In this case, it looks like the edits of declaring something to be polymorphic and the edits of annotating universe levels should be separate edits that can be used together. I have not found much information about "template universe polymorphic", except for this documentation: https://github.com/coq/coq/blob/master/dev/doc/universes.md |
Issue by lastland
Tuesday Mar 17, 2020 at 19:36 GMT
Originally opened as antalsz/hs-to-coq#151
It seems that an edit that makes a definition polymorphic would be helpful. I know that Eric has already been working on this, and I am opening this issue to list a few use cases I found.
The most basic form would be something like
set Foo.bar polymorphic
whereFoo.bar
is the qualified name of a definition. The definition can be a record, a type class, a type class instance, a function, an inductive or a coinductive data type, a variant, or a lemma/theorem/axiom (I have found scenarios where I want to make a lemma polymorphic)...Ideally, when the definition is an instance, we will also want to make all its class methods polymorphic (in Coq translations, they are separate definitions).
When the definition is an inductive or coinductive data type, a variant, or a record type, it would also be useful if a single edit can make it polymorphic and cumulative (maybe something like
set Foo.bar polymorphic cumulative
?)---the definition would not be cumulative by default otherwise (see: https://coq.inria.fr/refman/addendum/universe-polymorphism.html#cumulative-noncumulative).In some scenarios, we may also want to use a single edit to make everything in a module universe polymorphic. And in those scenarios, we may also want edits that can make a few definitions monomorphic.
The text was updated successfully, but these errors were encountered: