-
Notifications
You must be signed in to change notification settings - Fork 242
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
New Maybe Unary definition #2297
Conversation
Do you have a specific use-case in mind for this definition? |
Yes, I needed this data structure in my linear algebra library: VecPivotPos : (xs : Vector F n) (p : Fin n ⁺) → Set (ℓ₁ ⊔ ℓ₂)
VecPivotPos xs ⊤⁺ = Lift ℓ₂ (AllZeros xs)
VecPivotPos xs [ p ] = Lookup≢0 xs p |
Can this be defined directly by pattern matching, via |
Yes, it can. |
As a followup, then, some more questions (REVISED in the light of my looking again at
But, given that case analysis on |
I agree with @jamesmckinna. My personal feeling is that this relation isn't sufficiently "natural" to be added to the library... |
I think that this definition is more natural than In addition, I agree with @jamesmckinna about the problem that every time that we create a new data structure, we have to prove everything from scratch. While when we use |
I'm afraid that just because we can substitute something into an existing definition to get a relation, doesn't make that relation natural.
Looking at the problem, I'm not very convinced by the proposed use case either. I think your code would be expressed much more neatly using a sum type that either returns a proof that all entries are zero, or alternatively a Thank you for the proposal, but I think in this particular case we're not going to accept this unless a more convincing use case appears. Feel free to reopen the issue if you come across one! |
I created this definition because it is a new kind of relation different from the other definitions we already have. It is the same as
Data.Sum.Relation.Unary.All
when used with the unit type.