-
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
Introduce NonZero
to Data.Fin
as well
#1686
Comments
Oh? I found only |
Interesting corridor discussion. My eyes are somewhat more open about this now. |
In summary we want to avoid arguments of the form |
Yes, OK. In the first instance, though, moving to Sorry for not having had a more nuanced sense of these things until our discussion yesterday. Hmmm. |
Yes it would mean more uses of As for the more general point, yes that sounds reasonable. Although unfortunately we have no real (enforced) notion of private/public interfaces... |
Worker/wrapper idiom: I'd suggest leaving in the old 'worker' proofs then, and only add new ones expressed in terms of |
How's this one going? |
Hmm. See this branch for the beginnings:
What isn't there yet are:
Oh... and the |
Looks good, a PR along those lines would be welcome! But I was actually thinking of making the changes to the original operators rather than just adding the |
So I think I took the view that it was better to add wrapper operations
Question: where's the usability gain in changing the types of existing code? (my old friend knock-on viscosity...) |
My first PR #1830 to resolve this along the lines sketched above ... led to some controversial naming decisions. Suggest that we try to resolve that discussion here before proceeding with any further commits. Elsewhere, you've suggested using primes for the 'non-dependent' version of dependently typed functions. Here the situation is (slightly (?)) different, in that we are making distinctions on whether the telescope over which we eliminate is homogeneous/inhomogeneous in its indices... and I haven't elsewhere seen a naming convention for that... so suggestions welcome! |
Over and above the naming issue, do we also, if the spirit of this issue is to taken seriously, need to further expand the library to include 'computation'equational rules for all the consequent uses of pred? Is there a good closed form for eg pred(n !)? |
I will try to get back to this issue and linked PR later this week. Suggest we then close, but with the possibility of subsequent re-opening if there are good reasons to. |
So this feels like the tip of a very large iceberg. It's a symptom of a fundamental "how do we do APIs in dependently-typed programming?" question. Repeating some of the analysis above: One API uses arguments of the form Fin (suc n), but
The flip side is
i.e. replacing a particular shape (on which we can match) with a particular proof (made an instance argument here, but that's ergonomics, not fundamental). The downside is the use of This feels like it is mainly punting the problem down the road! The My feeling would be to split things. This change is making a bunch of modules expose a very large interface, with no guidance to users as to which one to use. I would be tempted to put all of these new functions into |
Regarding 'splitting': in the spirit of earlier responses to other issues/PRs of mine, I suggest that such a proposal/suggestion be the topic of a subsequent refactoring, My energy for pursuing this one is mostly exhausted by now, so I'd like it to be merged, and then we think again. Or do you regard the 'pushing down the road' as evidence that this approach is a non-starter? |
I'm fine with that (i.e. leave it to a subsequent refactoring). Fair to say that if I believe in this splitting enough, I should be willing to do it myself & not force you to do it. I don't think this approach is a non-starter. It feels almost as equally flawed as the current one. But, absent even a proposal for something better, all we're left is to try both of these and see what happens. It's just too bad we don't have a 2-layer standard library, with time-tested stuff in the stable layer, and stuff that hasn't been sufficiently tested in practice in an outer layer. Given the current development processes, best thing to do is to merge this one in as is. Then see how quickly I have energy to refactor. |
I'd be happy with that! |
@MatthewDaggitt what's your current thinking on this (and PR#1847)? |
Thanks for the prompt! I'll reply in the PR 👍 |
Suggest removing this from the v2.0 milestone. |
See also #1923, #1921. One way to think about the Now, @MatthewDaggitt 's objection (barrier to entry for newcomers) applies, perhaps (sigh), in spades to view-based programming in general (cf. @Taneb 's comment on #1921) but ... since at least as early as 2004 is something that I (and Conor, and others) think is an essential contribution of DTFP to programming in general, never mind to writing proofs in |
@MatthewDaggitt how attached are you/we to keeping this open? |
Yup sounds good. The idea was misguided I think. |
Just noticed we have similar constructor issues in various
Fin
operations and proofs.The text was updated successfully, but these errors were encountered: