-
Notifications
You must be signed in to change notification settings - Fork 273
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
Parameterized makeClassy #49
Comments
One problem is that there are a number of cases this approach can't handle, such as if one of the arguments to I do agree that it would be much nicer if |
Sorry, open/close was due to a careless button click. At any rate, I have been using |
I find The bliss is only hampered by (1) the lack of support for parameterized types, which is why I opened this issue; and (2) the need to specify the "instance HasFoo Bar where foo = barFoo" all over the place, which can be avoided using the following "passthrough" trick:
Mnemonics: in Implementation-wise, it seems like this would require adding a "_lensInstance" field to LensRules, allowing certain fields to trigger creating "classy" instances (this seems unrelated to the existing CreateInstance). Does that sound like a reasonable addition to |
Lets put it in as a separate issue. I'm not entirely sure how I feel about it. It could be useful but its also very 'magic', and probably not the right default behavior. Right now makeClassy has a pretty fixed scope (and an exceeedingly hairy implementation that has enough intrinsic complexity that i'm loathe to extend its scope in more ad hoc directions). That said, I don't have a particular objection to some kind of |
Dusting this off and starting to work on it again. |
I have this working. It passes the test suite, but could stand to have someone beat on it for a while. |
I'm going to close this out as ready to go. It really at this point "works for me", but could use a lot more testing. |
I'm wondering if we should move the |
I'd recommend opening that as a separate issue, I suspect we'll likely close it as wontfix / rejected given the sheer amount of code that would be broken, but it'd be better served as an issue than as a comment on a 3 year old issue nobody is looking at any more. |
Cool, thanks for the suggestion - I've moved it to #625 |
Here is a possible approach for implementing
makeClassy
for parameterized containers. It works without any type-specific logic, as long as all the types are functional dependencies of the container type. This is something I sorely need in my code...Sample code:
The text was updated successfully, but these errors were encountered: