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

Michael Truog <>
Sat May 7 04:43:03 CEST 2016


On 05/06/2016 10:25 AM, Robert Virding wrote:
> Yes, I am not alone in wanting these!
>
> Robert

I agree iterators on maps are helpful.  However, I think it is important to make sure the iterator returned from maps:first/1 is its own separate type.  In the past when you have suggested this, you appeared to indicate that the iterator would be a side-effect on the Map data.  However, if that was the approach, it would be limiting the map to using a single iterator at a time.  Other reasons exist why this would be a bad approach: potentially hiding side-effects of iterator usage in ways not represented by types, in ways that dialyzer wouldn't handle (the maps type is already complex), being the source of errors due to the lack of transparency (i.e., it should be breaking referential transparency).  So, the interface of maps:first/1 and maps:next/2 sounds good as long as it is dealing with a maps iterator type and not the map itself.

>
>
> On 6 May 2016 at 18:12, Jean Chassoul < <mailto:>> wrote:
>
>
>     On Thu, Apr 21, 2016 at 5:09 PM, Robert Virding < <mailto:>> wrote:
>
>         My maps:first/1 and maps:next/2will be coming when? :-)
>
>
>     +1
>
>     (=
>
>
>     _______________________________________________
>     erlang-questions mailing list
>      <mailto:>
>     http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160506/2bcbab09/attachment.html>


More information about the erlang-questions mailing list