-
Notifications
You must be signed in to change notification settings - Fork 8
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
Separate isomorphisms from lenses #205
Comments
I think isomorphisms are perfectly valid lenses. It might make sense to have isomorphisms as a "subtype" of lenses, and operations that only work on isomorphisms, like |
It's less an aversion to generic interfaces, more an aversion to subtyping in general. In this scenario, Re |
I just remembered something I said yesterday at RacketCon that I think I should put here, partly to remind myself. I think it makes perfect sense for That way it's safer too, because you know from looking at it that it returns an isomorphism. But if you used |
Closing in favor of current implementation. Future uses for isomorphisms on their own may require revisiting this. |
It might be a cleaner API for isomorphisms to be treated as separate entities from lenses. There could be a
isomorphism->lens
function that turns isomorphisms into lenses, as well asisomorphism-compose
,isomorphism-to
, andisomorphism-from
functions for using isomorphisms.I personally like explicitly requiring turning isomorphisms into lenses, and it removes isomorphism lenses' dependency on a generic interface for lenses.
@AlexKnauth Thoughts?
The text was updated successfully, but these errors were encountered: