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

Improve the discussions on TemplatePoly and UnivPoly #46

Open
thomas-lamiaux opened this issue Sep 1, 2024 · 4 comments
Open

Improve the discussions on TemplatePoly and UnivPoly #46

thomas-lamiaux opened this issue Sep 1, 2024 · 4 comments

Comments

@thomas-lamiaux
Copy link
Collaborator

Improve the discussions on TemplatePoly and UnivPoly, in particular on performances
https://github.com/coq/platform-docs/blob/main/src/Explanation_Template_Polymorphism.v

@MevenBertrand
Copy link
Contributor

I have a few minor improvements (basically, typos, including one in the code), for now it's on a branch of mine here. I can open a PR if you want them.

The tutorial makes it sound like universe poly is strictly better than template poly in most (all?) cases. However, there is the caveat that template poly also extends to Prop and Set (and SProp, too, I think), but universe poly does not: you cannot replace a polymorphic universe by Prop. This is somewhat implicit in the tutorial, but might be better to make explicitly?

Also, this is the reason for the new and shiny sort polymorphism coming up starting in 8.19 (not sure this is worth mentioning at this point, but that means that the tutorial might need changes once sort poly is consolidated).

@SkySkimmer
Copy link
Contributor

univ poly handles Set and sort poly handles Prop/SProp
template poly does not handle SProp

@MevenBertrand
Copy link
Contributor

I thought there were (used to be?) restrictions about replacing a universe poly variable with Set, but my bad!

@thomas-lamiaux
Copy link
Collaborator Author

Don't hesitate to make a PR if you have improvements.
The tuto is a bit biased hence this issue, and we hope to improve over time with contributions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Improvments Needed
Development

No branches or pull requests

3 participants