-
Notifications
You must be signed in to change notification settings - Fork 247
Added Data.Vec.updateAt and its properties. #510
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
Conversation
@andreasabel sorry it's taken me so long to look at this. It all looks good! My only comment is that I don't find the |
Suggested by Guillaume Allais for consistency. Note that it is equal to updateAt-cong-relative after updateAt-compose.
@MatthewDaggitt
I removed the notation in 0156aee, for comparison. If you find that easier to read, please go ahead an merge (unless you have other concerns). Otherwise you can revert that commit. |
Thanks, merging in. Will fix the uncomment typo. |
Thanks for merging! |
Generalized Data.Vec._[_]:=_ (update) to updateAt which applies a function to the vector element pointed to by the index. I generalized all existing laws for update to updateAt.
Possible bikeshedding:
updateAt
We should have a uniform name for updating a point in a collection (list, vector, finite map) by a function which modifies its value. The updateAt operation is more general than overwriting an element (which is a trivial special case of updateAt).