Hi, after having used this functionality in several different projects I like to propose it to be included in Elixir:
Enum.zip_by/4 is similar to Enum.zip/2 but takes a function which determines the identity of elements (most often through some kind of identifier). That means elements can end up having no matching element in the other list. It is very handy when doing merges or updates of any kind. I mostly use it as a preparation step to make on-by-one decisions of how a merge is handled. Here is what I put together so far: https://github.com/elixir-lang/elixir/compare/master...odo:zip_by There are some things that I think could be improved where I like to have some input: - The code seems a bit bulky, compared to the other functions in the Enum module (comments could be removed) - I don't really like the name of the do_zip_by/3 recursive function - Both enumerables have to traversed several times (mapping, sorting, matching) Let me know what you think. Thanks, Florian -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/e4bfde94-a39f-402c-9487-205dfe59acbf%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
