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

[ new ] add Data.List.grouped function #3089

Merged
merged 2 commits into from
Oct 13, 2023
Merged

Conversation

stefan-hoeck
Copy link
Contributor

Description

This adds a new function to Data.List for grouping a list into equal sized sub lists. For instance, group 3 [1..10] will return [[1,2,3],[4,5,6],[7,8,9],[10]]. I took the function's name from a similar function in Scala (see here).

The implementation is tail-recursive and runs in O(n).

Should this change go in the CHANGELOG?

  • If this is a fix, user-facing change, a compiler change, or a new paper
    implementation, I have updated CHANGELOG.md (and potentially also
    CONTRIBUTORS.md).

@gallais gallais merged commit 7fbbb03 into idris-lang:main Oct 13, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants