-
Notifications
You must be signed in to change notification settings - Fork 632
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
Projections can be made classes but you can't define instances #8994
Comments
The problem here is that |
Are you saying that |
Yes, it is exactly this. Here is a workaround that @ppedrot will probably say I'd be terrible for relying on: Set Primitive Projections.
Class type (t : Type) : Type :=
{ bar : t -> Prop }.
Instance type_nat : type nat :=
{ bar := fun _ => True }.
Existing Class bar.
Global Instance foo_bar {n : nat} : match @bar with x => x _ _ n end := I. |
However, note that this workaround, while it gets the statement to be accepted, probably does not solve your problem. The instance gets picked up on Check _ : match @bar with x => x _ _ _ end. but not on Check _ : @bar _ _ _. |
Thanks, @JasonGross . I definitely don't want to do the workaround :-). This isn't a crucial issue for me right now. |
Indeed. |
- fixes HoTT#1541 Signed-off-by: Ali Caglayan <alizter@gmail.com>
- fixes HoTT#1541 Signed-off-by: Ali Caglayan <alizter@gmail.com>
Version
Operating system
Ubuntu 18.04
Description of the problem
Expected behavior:
bar
should be a typeclass so there shouldn't be a problem with the definition offoo_bar
as an instance.If there is a reason to forbid supporting this, then there should be an error on the call to
Existing Class bar
.The text was updated successfully, but these errors were encountered: