-
Notifications
You must be signed in to change notification settings - Fork 143
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
Update Prelude.agda #1179
base: master
Are you sure you want to change the base?
Update Prelude.agda #1179
Conversation
make refl and lift instances
What is the point of this PR? (I'm not so familiar with instances in Agda) |
Instances in agda are basically a way to automate mechanical tasks. For example, take a look at how the 1lab uses instances to automatically calculate the hlevel of a type, allowing you to simply type hlevel! and solve the hlevel of a complicated type instead of manually using isSetPi2 IsSetSigma isSetSetQuotient isOfHLevelRespectEquiv blah blah blah. I made this PR, because earlier while using Cubical, I found myself needing an instance of Unit* which is Lift Unit, (even though there already is an instance of Unit), and I was surprised to find nobody had bothered to write the 3 lines of code needed to lift instances. And I also made refl an instance. |
I think we should not make things instances in this way. It should be a decision of the user, to use instances or not. So if you want to make |
fixed the error
Just in case this is not clear: Before making an "open" (there is also a "draft" option) pull request, you should check your changes with agda. |
What do you mean? It still will be the decision of the user to use instances or not. Making refl an instance won't affect the ability of the user to use it like a normal term in the way it has been used. It only allows Agda to find it in instance search. Same for lift. So this change is 100% backwards compatible.
The problem with this definition is that whenever a user wants to apply
Now when the user wants to compute, say,
(here ≡no is a function in the library) |
With "using instances" I meant that something is included in the instance search. I imagine it could be a problem to have to many instances at the same time. I would expect that it can get hard to figure out why some instance is not found by agda. Can you try to check the whole library with your changes? |
I see, looks like adding a instance for Sigma is conflicting with its use in Cubical.Algebra.CommRing.Properties? So I should either enable --overlapping-instances or remove the Sigma instance altogether. However the |
How do I type-check the library now? |
I was adviced by agda developers to not use overlapping-instances, so I would only accept that, if there is a very good reason. |
It looks like I have to have Agda installed on my computer to run make? If that's the case, I can't do that (I use Agdapad to code) |
I think you should switch to an installed version of agda at this point. |
make refl and lift instances