-
Notifications
You must be signed in to change notification settings - Fork 165
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 usability improvements, examples ? #62
Comments
|
But this works:
|
It might be a misunderstanding of lens principles on my part. I can see how an accessor following one that returns multiple values could need to be a monoid.. but asItems gets a singular value - a List - so I'm confused. |
And here are the current type definitions: https://gist.github.com/simonmichael/f75813855f56c54b08e19f89155517da |
To do this it generates Lenses when they are total and Traversals when they are partial, and
and the types of the lenses generated:
and so:
Regarding the missing |
Experimenting with lenses to reduce record accessing/updating noise. So far, it's not at all a clear win. cf jtdaugherty/brick#62
That is very clarifying, thank you very much! I would like to get rid of those partial record fields, but I haven't found a better solution yet. I wonder how you are seeing those nice types in GHCI (Lens' & Traversal'). I get the more verbose:
with GHC 7.10.3 and the latest types. |
Now that we've explored what was going on here, is there anything remaining that you need me to address? Or can this be closed? |
Feel free to close it. I don't know if adding listSelectedElementL is appropriate. |
Right now
so that you could then do
Is this what you have in mind? |
@simonmichael - this ticket has been open for a while. Do you still have anything specific you'd like to see here? Or can I close it? |
Close away, thank you @jtdaugherty . |
Thanks! |
(micro)lens seems desirable for working with nested records in a brick app. I just started to exploring this, and am finding it harder than expected. Notes so far:
The text was updated successfully, but these errors were encountered: