[erlang-questions] Wanted additions to the maps module?

Andrew Berman rexxe98@REDACTED
Sun May 8 20:31:47 CEST 2016


Sorry, Björn-Egil, I just had the need come up while developing a couple
days ago, so I thought I'd throw maps:zip on the radar.

On Sat, May 7, 2016 at 3:58 PM Björn-Egil Dahlberg <
wallentin.dahlberg@REDACTED> wrote:

> I think it's great that you all have many suggestions. It took a month
> before the thread got going. =)
>
> maps:take/2 and maps:update_with/3 has already been implemented.
>
> iterators or any variants thereof are a no-go for 19.0.
>
> maps:merge with fun should be the the dict equivalent. However some
> thought needs to go into this - a safe way to apply a fun while in midway
> through a BIF - doable but needs som redesign. Some composability.
>
> maps:zip/unzip needs to be fleshed before I can consider it.
>
> After 19 I will try to shift focus to iterators and then the compiler,
> specifically the match compiler. This is however dependent on other prio
> work i have in my backlog.
>
>
>
> 2016-05-07 23:47 GMT+02:00 Andrew Berman <rexxe98@REDACTED>:
>
>> That's fair, Fred.  And yeah, I can definitely do the two-step process
>> for now, but lists:zip/unzip are also just helper functions for what can be
>> done with a list comprehension.  I totally understand not bloating the maps
>> module, but if it mimicked the lists module with certain functions, I think
>> it would be ok, plus there's nothing really new to learn.  In other words,
>> if you know what lists:zip does, you know what maps:zip does.  We're not
>> redefining what the zip function actually does.
>>
>> On Sat, May 7, 2016 at 4:21 AM Fred Hebert <mononcqc@REDACTED> wrote:
>>
>>> On 05/06, Andrew Berman wrote:
>>> >Not sure if this was mentioned yet, but a maps:zip addition like what
>>> is in
>>> >lists only building a map would be really handy.
>>> >
>>> I kind of feel it should *not* be there unless we'd be ready to also
>>> have a maps:unzip in there; right now lists:zip and lists:unzip can be
>>> combined with maps:to_list and maps:from_list to do what you need, but
>>> if you add in maps:zip and forget maps:unzip, that feels incomplete to
>>> me!
>>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160508/e1a5f3fc/attachment.htm>


More information about the erlang-questions mailing list