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

Store lens composition as a list #2

Open
cfhammill opened this issue Sep 24, 2018 · 3 comments
Open

Store lens composition as a list #2

cfhammill opened this issue Sep 24, 2018 · 3 comments

Comments

@cfhammill
Copy link
Owner

Collapse them at over/view, this would facilitate editing lens stacks. @bcdarwin care to weigh in?

@cfhammill
Copy link
Owner Author

I think I've mostly convinced Ben this would be useful. The remaining questions are:

  1. Are lists the right thing, or would writing lazy compose with appropriate lenses be better.
  2. How (in)efficient would this be. My guess is it would be fine, but remains to be tested.

@bcdarwin
Copy link
Collaborator

bcdarwin commented Oct 4, 2018

I don't mind lenses being represented as an explicit AST (e.g., %.%, map_l, etc. merely store their arguments). In this case we might have some (lens!) combinators for various traversals of such a tree, but I guess the only thing you could do at a leaf is compare for identity, so I guess each lens would now have a name field which would ideally be the name of the lens plus a freshly generated symbol.

@cfhammill
Copy link
Owner Author

Generating symbols seems unnecessary as we both noticed, I'm fine with naming and equality checking as the primary way to inspect the elements of the lens composition, with shady folks like me potentially doing runtime code inspection for rare occasions where that would be useful.

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

No branches or pull requests

2 participants