Repository navigation
#6238: Allow flat matching on inductive families - #6239
Conversation
|
As far as Let's try rewriting the definition to use paths. Initially, only the domain: this is a simplification of the cause translation that module _ {@♭ A : Set} {@♭ u v : A} where
p : @♭ (u ≡ v) → Id (flat u) (flat v)
p path = transp (λ i → Id (flat u) (flat (path i))) i0 reflIdThis doesn't check because in that inner term we need to have q : @♭ (u ≡ v) → flat u ≡ flat v
q path i = flat (path i)But of course we hit the same problem, since now the |
|
Can you explain why silencing the check could be bad? |
|
I guess the core of the point I'm making is: in Cubical Agda, indexed types are implemented as types which store paths, so to commute "type indexing" and So a "better" fix for this, IMO, would be to keep the check as-is but make the generated code modality-correct, and that starts by making |
|
Is the cohesive stuff supposed to work together with Cubical Agda? One option might be to hide the cohesive stuff behind a flag, and make this flag incompatible with |
|
@nad: I don't want to stall the release with this - when I need it, I'll just use not put it in a library and use a patched version of agda. |
|
Others might also use this feature. An alternative fix is perhaps to turn off the check only when |
Yes! That is actually what I did here. |
I'm a bit confused about the status of this. Last time I tried, this worked on master, but isn't there a PR that stops that? |
I mean, I wrote user level code doing that - what you suggest seems to be on the level of generated code? |
|
My understanding of the situation is that we have the following two independent-ish problems:
And there are three-ish possible fixes, as I see it:
Having put it like this, even though I objected initially, I think approach (2), with the goal of eventually moving to (3). But then we should have a separate issue for integrating |
|
I see - thanks for putting everything together so clearly. |
|
I don't think we should do any large changes just before the release, but I also don't think we should break code that used to work without having a good reason for doing so. Is there any "real" code that uses both the flat modality and Cubical Agda? If not, then I think we should hide the flat modality behind a flag (if that is easy) and disallow the combination of this modality and |
|
Decision: We'll add a new |
|
... and turns out we already have |
|
Is the new plan to not have a flag that enables the flat modality? I think it would make sense to have such a flag. |
I thought that was about something else. I think it was supposed to disallow some pattern matching and Andrea put it in after Colin Zwanziger asked about it. |
|
My idea was to make |
|
Ah - I see. Makes sense to me. |
When --flat-split and --cubical(-compatible) are used (which is not --safe), --flat-split behaves as an injective flag. Furthermore, in that case, the transpX clauses will not be generated for the function. (We skip this by failing the LeftInv computation, so that a NoEquivWhenSplitting warning is printed indicating the defn. won't compute)
b5f5fd0 to
c057c75
Compare
|
I did a formal review:
|
|
(Meta comment concerning branch protection: We did not explicitly/consciously activate it, but now merging seems to be blocked when someone requests changes. Ok, let's run with it. Also, it seems one can still directly push to |
andreasabel
left a comment
There was a problem hiding this comment.
Thanks for fixing!
If you want to add one more test (--without-K) that would be nice.
I think admins do bypass branch protection rules, yeah.
If there have been commits to the PR branch since the review, then admins and people with write access can dismiss them (quoting the GH docs):
|
|
Thanks for the added test! (N.B. Concerning stray files: Since I use |
As argued in #6238, it should be possible to match on flat variables of inductive families.
As suggested by @nad , this can be fixed analogous to how it was fixed for Irrelevance here.