Skip to content
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

lens mode .name should generate Isos where possible #26

Open
kenbot opened this issue Feb 26, 2017 · 1 comment
Open

lens mode .name should generate Isos where possible #26

kenbot opened this issue Feb 26, 2017 · 1 comment

Comments

@kenbot
Copy link
Owner

kenbot commented Feb 26, 2017

Using the .name syntax, get and set modes generate the most general possible optics, Getters and Setters respectively. This means that more code can participate, such as no-arg methods with no copy method. Because we already know what we want to do with it (ie "get", "set"), there is no need for more capable optics to be selected.

Conversely, lens mode produces an optic; we don't know how the user will use it. Therefore, we should choose maximally capable, specific optics, rather than constrained generic ones. Currently, Lenses will be generated.

In lens mode, where a target value is known to be isomorphic to the source object (ie a one-argument case class), then an Iso should be generated instead of a Lens.

@kenbot
Copy link
Owner Author

kenbot commented May 18, 2017

Descoping from 1.1; it's not urgent, and it is still uncertain how much work it might entail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant