Skip to content
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

Add the FVect datatype #17

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

mattpolzin
Copy link
Member

This adds the Data.FVect (fin-based vect) datatype as proposed in #16. It also adds Data.FVect.Capacity which is a view into an FVect that makes it easy to add to an FVect if it has any capacity (or prove it is full otherwise).

Please let me know if you would like to see any changes, additions, or subtractions from the included modules.

@Matthew-Mosior
Copy link
Collaborator

Really excited to have this in the codebase, this lgtm!

@stefan-hoeck

Any changes you'd like to see?

@stefan-hoeck
Copy link
Collaborator

Thanks for this addition. Out of curiosity: Can you give an example when you found this data structure to be useful?

@stefan-hoeck stefan-hoeck merged commit 3577db8 into idris-community:main Jan 21, 2025
2 checks passed
@mattpolzin mattpolzin deleted the add-fvect-type branch January 21, 2025 15:34
@mattpolzin
Copy link
Member Author

Can you give an example when you found this data structure to be useful?

I looked around and I don't have any long term projects that use it so although I've used it for several explorations in the past I cannot recall exactly how it was used. We'll need to settle for the abstract conceptual need "I know that when I perform a filtering operation on a vect, its length is less than or equal to its length prior to the operation -- I want to structurally encode that property instead of proving it ad-hoc." That was my original motivation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants