-
Notifications
You must be signed in to change notification settings - Fork 19
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
Support insert
with dynamic DynamicIndexLens
#132
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks a lot @MasonProtter. Actually surprised that this did not came up before.
Happy to help! |
I'd recommend being very cautious with adding something like this. Typically, we have Try |
What is nice about that property? |
These optics laws are quite deeply ingrained into Accessors, and make it possible to reason about optics code generically. The most basic one is So, unless there's a very strong reason to break this law, would be best to keep following it. |
I guess I'd say this sort of use-case this seems to be the entire point of |
Just wanted to clarify the abstract law reasoning with a concrete example. A neat way to make julia> max([1,2])
ERROR: MethodError: no method matching max(::Vector{Int64})
The function `max` exists, but no method is defined for this combination of argument types.
Finding the maximum of an iterable is performed with `maximum`. |
Yeah I think promoting |
Sounds good. |
Before:
after: