-
Notifications
You must be signed in to change notification settings - Fork 10
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
Contracts for resolvers are inflexible #11
Comments
Let me make sure I know what you mean. Do you mean that we just provide the existing resolvers plus a constructor of One one hand, I like this simplification, but it would effectively mean that we don't really expect anything other than |
By the way, I'm currently working on moving the Gregor code into a new tree while cleaning it up a bit. The biggest change is that I'm simplifying the internal representations of the basic data types. For example, instead of the More to the point, though, I'm also making two changes to resolvers:
|
Re: clarification - I believe that's what I mean. Let me be more explicit: I would create a module defining This does mean only Gregor is capable of using the resolvers, meaning nobody can implement |
Offset/gap/overlay resolvers are functions with a particular kind of signature. If the API changes in a way that new parameters need to be added, removed, or moved around, all client code using custom offset resolvers breaks. The details of a resolver's implementation are only useful to Gregor users constructing their own resolvers - most users don't need anything beyond the already provided ones. Instead Gregor could provide constructors that accept the resolver functions and produce opaque resolver values instead. This has a number of advantages:
This is something that bit me in the lens package a while back. It would be tricky to add this to Gregor in a backwards compatible way, but it could be worth it. Let me know what you think!
The text was updated successfully, but these errors were encountered: