-
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
The design of 'free objects' #2539
Comments
I should also link in #2287 "Mechanize the Algebra hierarchy". I think that the design space for both are quite similar and should likely have a similar solution. |
Thanks @JacquesCarette for opening this issue after all my nagging about it. I guess my original 'by hand' version(s) were a ham-fisted attempt towards provoking such discussion (as well as attempts to contribute a version of The abstract 'universal property' version of (Omitted: Potential digression about Dedekind's (1887) approach to As well as, perhaps, a lot of hidden 'boilerplate' (shared between all approaches?) as to what is required even to state the required universal property for a given Each representation will then cash out differently as to proving the relevant 'existence' and 'uniqueness' properties of such (More later, but I thought it worth putting those two markers down: I think each approach carries 'boilerplate' with it, but we seem to have different tolerance levels regarding the two, as well perhaps as ideological/religious positions as to what is tolerable, and why...? If what I have written so far seems too ranty, happy to re-edit ...) As to meta-programming as an approach to making such constructions generic/generative wrt a given signature+axioms, that would be good (modulo the fitness-to-purpose of existing tooling), and all the better if it can be internalised via an Agda universe construction. We should also look more closely at the frex work esp. implementation in |
Yes, definitely need to look at FREX and its idris implementation. All these ponderings have made me realize one thing: we already have, at least, all of "FreeMonoid" already implemented in Maybe we should implement 'Free' via universal properties, and implement a handful of specific cases "by hand" because they are so pervasive. And we don't have to give them overly fancy names (Maybe isn't called FreePointed after all).
|
I feel strongly that it's (doubleplus emphatically) not a good thing to conflate Maybe In a simpler setting: |
This issue is a place to discuss the design of what we'd like. @jamesmckinna gave a first PR (#1962 ) that has been long stalled (because of, well, me!)
So let's try to get it going again. My biggest worry is the ridiculous amount of boilerplate. This is not @jamesmckinna 's fault, it is inherent to attempting to define 'free object' completely by hand by unrolling all the definitions. Not only are the definitions unrolled, a whole lot of useful 'kit' is also provided (normally a wonderful thing!) also by unrolling all the definitions. Wikipedia's Free object article is quite readable to get a sense of what all that is. Its list of free objects shows us how much this is going to explore. Plus that list is far from complete.
Maybe we should instead bite the bullet and do this properly categorically.
Another approach would be to follow something largely along @jamesmckinna 's design but, rather than doing it all by hand, doing it via meta-programming. We couldn't do it using Agda's own meta-programming features (I don't think) but we could certainly do it in Haskell -- maybe even by using Agda itself as a library. (Maybe @TOTBWF might be interested in that.)
The text was updated successfully, but these errors were encountered: