Skip to content

Data.Vec.Functional operations and properties #1241

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 7 commits into from
Jun 28, 2020
Merged

Data.Vec.Functional operations and properties #1241

merged 7 commits into from
Jun 28, 2020

Conversation

calintat
Copy link
Contributor

I added a bunch of new functions in Data.Vec.Functional and also made a Data.Vec.Functional.Properties module. This is mostly stuff that I needed in one of my projects, but I'm happy to add more stuff if people are interested (either in this PR or a future one).

I think Data.Vec and Data.Vec.Functional should ideally have the same functions, so people can swap one module for the other easily (like I needed to do in my project). However, some existing functions in Data.Vec.Functional have slightly different types compared to their analogues in Data.Vec. For example, the order of arguments of remove is different:

-- Data.Vec.Base:
remove :  {n}  Vec A (suc n)  Fin (suc n)  Vec A n

-- Data.Vec.Functional:
remove :  {n}  Fin (suc n)  Vector A (suc n)  Vector A n

and foldr/foldl in Data.Vec take a dependent function, whereas foldr/foldl in Data.Vec.Functional take a non-dependent function. I think these functions in Data.Vec.Functional should be changed to match the ones in Data.Vec, but such changes would break backwards-compatibility. What do you think?

Copy link
Contributor

@JacquesCarette JacquesCarette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful additions. I only saw a few things that should be revisited.

@gallais
Copy link
Member

gallais commented Jun 20, 2020

Standardisation of folds is a long standing issue (#278).
I agree that all of the discrepancies between the order of arguments should
be solved. Could you document the one you found by opening an issue?

@calintat calintat requested a review from JacquesCarette June 27, 2020 16:49
@MatthewDaggitt MatthewDaggitt merged commit 9593409 into agda:master Jun 28, 2020
@calintat calintat deleted the vector branch June 28, 2020 11:22
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.

4 participants