-
Notifications
You must be signed in to change notification settings - Fork 240
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
The type of a data
constructor should *not* have repeated indices unless defined within the scope of with-K
#2519
Comments
I agree this is a good principle going forward. However, how many definitions fall foul of this currently? Depending on the numbers I would be weary of how big a breaking change this would be to change all the existing definitions? |
I haven't done a survey of the relevant definitions, besides More generally, I'd advocate piecemeal refactoring in the interests of avoiding 'large' breaking changes? |
I agree with the design principle. My gut feel is that this isn't likely to occur very often. But this is rather hard to search for! So piecemeal refactoring is indeed a rather reasonable way to go. |
Can you clarify what exactly you mean by "non-linear" here? Is it that the same variable should not appear in two different indices of a data constructor? |
Yes, exactly. I'll change the title of the issue. In the originating PR #2504 it's actually even stronger than that, because it meant that those indices could even become parameters to the |
data
constructors should *not* be non-linear unless defined within the scope of with-K
data
constructor should *not* have repeated indices unless defined within the scope of with-K
See the discussion on #2504 for a specific instance.
This raises the issue to library level, given the ambient
stdlib
assumption ofcubical-compatible
/without-K
.data
constructors which exploit repeated occurrences/'non-linearity' are making implicit appeal to reflexivity of (propositional) equality, and that should instead be required as an explicit witness. Specialising the constructor to supplyrefl
as a default witness should be the preferred approach to offering a non-linear constructor. Cf.Data.Nat.Divisibility.Core
#2013The text was updated successfully, but these errors were encountered: