Skip to content

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

Merged
merged 4 commits into from
Dec 27, 2018

Conversation

andreasabel
Copy link
Member

@andreasabel andreasabel commented Oct 20, 2018

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:

  • name of 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).

@MatthewDaggitt
Copy link
Contributor

@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 _≡_↾¹_ relations very intuitive to read. I think it would be much clearer if it was written out longhand. Would you mind if I changed it?

@MatthewDaggitt MatthewDaggitt added this to the v0.18 milestone Dec 7, 2018
MatthewDaggitt and others added 3 commits December 24, 2018 15:35
Suggested by Guillaume Allais for consistency.
Note that it is equal to updateAt-cong-relative after updateAt-compose.
@andreasabel
Copy link
Member Author

@MatthewDaggitt
Sorry, I myself also did not look at my PR (was busy teaching).

don't find the ≡_↾¹ relations very intuitive to read
Ah, too bad, I thought it was a natural step there from the function restriction notation ↾ of set theory.

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.

@MatthewDaggitt
Copy link
Contributor

Thanks, merging in. Will fix the uncomment typo.

@MatthewDaggitt MatthewDaggitt merged commit dcf89d0 into agda:master Dec 27, 2018
@andreasabel
Copy link
Member Author

Thanks for merging!

@MatthewDaggitt MatthewDaggitt modified the milestones: v0.18, v1.0 Feb 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants