Skip to content

🐌 Add a lazy/iterable version of the flatten function#7

Merged
lrhoek merged 4 commits intoAnarchitecture:mainfrom
timfennis:feature/iterable-flatten
Jan 24, 2026
Merged

🐌 Add a lazy/iterable version of the flatten function#7
lrhoek merged 4 commits intoAnarchitecture:mainfrom
timfennis:feature/iterable-flatten

Conversation

@timfennis
Copy link
Copy Markdown
Contributor

This PR adds a lazy version of flatten (or at least a version that accepts an iterable of iterables).

In the end I chose to make preserve_keys behavior configurable which is somewhat inconsistent with the rest of this library. Because I introduced extra arguments I also made the function return a unary callable instead of doing the work directly to make it easier to use. This however is inconsistent with array_flatten, so I'm open to changing it.

As a drive by change I also added the unit tests to the autoload-dev section of composer.json, this helps my IDE.

@lrhoek lrhoek merged commit e34c4f0 into Anarchitecture:main Jan 24, 2026
1 check passed
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.

2 participants