Core: Core provides List.unzip but not List.zip

Created on 26 Oct 2016  路  6Comments  路  Source: elm/core

I came to Elm after playing with a few functional languages before briefly and was surprised to find that List.unzip exists, but not List.zip. I know that it's trivial to derive zip from List.map2, but it seems strange to provide one but not the other.

Most helpful comment

for what it's worth, I too think that zip should be provided in the core lib, as it's more intuitive than map2 (,)

I thought that Elm aimed at being intuitive and lowering the barrier to entry - this choice seems to go against this philosophy

All 6 comments

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

This has been discussed on the mailing list in the past. The current situation is deliberate. So this is not reporting a bug or surprising deficiency of the library. Feature requests are usually not discussed here on GitHub, but instead on the mailing list. Moreover, there is the http://package.elm-lang.org/packages/elm-community/list-extra package that does contain List.Extra.zip. The guidelines for this repository here explicitly say that new functions should be proposed for such extra packages instead of being proposed straight for inclusion into core: https://github.com/elm-lang/core/blob/master/CONTRIBUTING.md#adding-new-functions

Given all the above, I'm closing the issue here.

Maybe an explanation or a link to the explanation would be helpful. I don't understand why a standard function in other functional languages such as "zip" should not be in the core library. Just saying that it is deliberate doesn't seem sufficient and makes me think it is a arbitrary decision.

Ask on the mailing list, or search the archive of the mailing list for previous discussion on this.

Everything else said in my previous comment above stands as well.

For those finding this in the future and wondering what the discussion was on the mailing list, the only discussion I could find (on elm-discuss or elm-dev) is this one where several people raise the confusion that the author here raises. If anyone can find any other discussions please do link to them here for the benefit of others. There appears to be no conclusion on the discussion either way.

I understand the contribution guidelines mean this is not the right forum for proposing this change, but it looks like there's some support for it, so it might be worth a proposal on the mailing list.

for what it's worth, I too think that zip should be provided in the core lib, as it's more intuitive than map2 (,)

I thought that Elm aimed at being intuitive and lowering the barrier to entry - this choice seems to go against this philosophy

Was this page helpful?
0 / 5 - 0 ratings