Skip to content

Soft-deprecate List.zip/1 in favor of Enum.zip/1 #13767

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 2 commits into from
Aug 9, 2024

Conversation

sabiwara
Copy link
Contributor

@sabiwara sabiwara commented Aug 8, 2024

As discussed, List.zip/1 is actually less efficient than its Enum counterpart and doesn't make much sense API-wise.

It seems it was just introduced a long time ago and was never removed after Enum.zip/1 got introduced.


"""
@spec zip([list]) :: [tuple]
@doc deprecated: "Use Enum.zip/1 instead"
Copy link
Contributor

@v0idpwn v0idpwn Aug 8, 2024

Choose a reason for hiding this comment

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

Deprecated or not, I think it could be nice to delete the existing implementation and delegate to Enum.zip/1 :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, I was hesitant since it will now support a list of enumerables and not just a list of lists... but that's not breaking, will go for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 208f5c2

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a good point, maybe it wasn't a great idea. Let's see what people think

Copy link
Member

@whatyouhide whatyouhide left a comment

Choose a reason for hiding this comment

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

I think it's nice to get rid of a bunch of code since we're deprecating here 🙃

@sabiwara sabiwara merged commit fe2425a into elixir-lang:main Aug 9, 2024
9 checks passed
@sabiwara sabiwara deleted the deprec-list-zip branch August 9, 2024 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants