It's not the *standard* library, but this function and a ton of other List
stuff is available in elm-community/list-extra
<http://package.elm-lang.org/packages/elm-community/list-extra>



On Tue, Oct 25, 2016 at 11:07 AM, <[email protected]> wrote:

> I agree with Luis and Gulshan. Having a "zip" function without a
> corresponding "unzip" reduces the readability and intuitive discoverability
> of the language.
>
> This is my Python sensibilities talking, I know. Python also haze "zip"
> and I thought it also had "unzip". But when I tried it, I realized that
> "unzip" is not in the Python standard library. And I've been using Python
> for many years now!
>
> I realized that the Python equivalent of "unzip" is the List
> Comprehension. Here's a really bad example (in Python):
>
> >>> a = []
> >>> b = []
> >>> c = []
> >>> [(a.append(x), b.append(y), c.append(z)) for (x, y, z) in [(1,2,3),
> (4,5,6)]]
> [(None, None, None), (None, None, None)]
> >>> a
> [1, 4]
> >>> b
> [2, 5]
> >>> c
> [3, 6]
>
>
> I'm very new to Elm, so I don't yet know if there's something analogous to
> List Comprehension.
>
> In any case, this helped me see that "unzip" is non-trivial in any
> language. I can understand it being left out of a standard library.
> (Though, if Elm solved this, I would cheer. :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to