[erlang-questions] maps:first
Lukas Larsson
lukas@REDACTED
Tue Aug 13 15:41:12 CEST 2019
On Tue, Aug 13, 2019 at 3:34 PM Oliver Bollmann <oliver.bollmann@REDACTED>
wrote:
> I often need maps:first(Map), is there plan for it?
>
No, there is currently no plan for it, as I cannot think of a use case when
it would be useful, but that might just be poor imagination on my part.
What do you use maps:first for?
> My current implementation is:
>
> first(Map) ->
> case maps:next(maps:iterator(Map)) of {Key,Val,_} -> {Key,Val};
> none -> none
> end.
>
> Create the iterator always a new map?
>
> --
> Grüße
> Oliver Bollmann
>
> _______________________________________________
> 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/20190813/e0aa6620/attachment.htm>
More information about the erlang-questions
mailing list