-
Notifications
You must be signed in to change notification settings - Fork 239
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
Data.Nat.Properties.≤-total should be implemented with _<ᵇ_ #2436
Comments
Given your comment about |
@jamesmckinna I don't understand your question. I noticed this problem when I wrote some code generic over a We could define ≤-total : Total _≤_
≤-total m n with m ≤? n
... | yes m≤n = inj₁ m≤n
... | no m≰n = inj₂ (≰⇒≥ m≰n) |
I think that was the suggestion, and I think it's worth the reorganisation. |
Yes, sorry if my comment was too oblique... @gallais is correct. Cf. my v2.0 refactorings of Moreover, the proof you offer, modulo the equivalence of But I did even wonder if such a (re-)definition should moreover be under Not sure why the reordering of |
@gallais does this qualify as a |
I'm not sure how much we should change things wrt efficiency. What I mean is that it makes a lot of sense to have (at least) two different definitions of many concepts, one 'conceptually clean' and one 'efficient'. There's quite a number of things in (for example) I think it's a false choice to "choose" between certain definitions. Rather we should have parallel hierarchies of definitions (and equivalence proofs). I'd be happy with, say, There was a reason for that paper on "Realms"!! |
@JacquesCarette in this case, there shouldn't be anything downstream of |
I would be strongly against |
I wasn't advocating using a |
Again, re:labelling this issue, not sure why this is a |
Ah sorry, I originally labeled it a refactoring before re-labeling it a performance bug and removing the |
So while I was probably misguided to rant about spec vs fast on this particular issue, it still seems that there is an issue (but with reduction behaviour). Though I must admit that I'm getting increasingly sad when we do have code that does that (depend on reduction behaviour). Having said that, I do understand that Agda may not be quite ready to deal elegantly with implementation-obliviousness. |
@JacquesCarette writes:
I absolutely agree, and/but what I'm not clear about is whether we should be more diligent as contributors/reviewers in trying to enforce this: eg I'm increasingly fastidious about replacing uses of A long time ago, I read a very good piece (where? google can't seem to help me find this... a mailing list somewhere?) by Frank Atanassow explicitly critiquing the use of dependent types in programming precisely because of the almost inevitable temptation/necessity of exposing implementations in types... ... and even longer ago, two authors argued for the use of dependent types in programming precisely because of its ability to (better!) support Wadler's idea of allowing pattern matching to cohabit with data abstraction, not least because such analyses tend/have tended to focus on extensional behaviour (wrt reduction) rather than complexity-sensitive intensional behaviour... so it seems we still have a long way to go ;-) |
It's very slow for
≤-total
to decide which constructor to use, especially compared to≤?
. This is an issue usingData.Nat
with code generic over aTotalOrder
- it's far slower than it could be.The text was updated successfully, but these errors were encountered: