[erlang-questions] lists module functions for maps?

Richard O'Keefe raoknz@REDACTED
Tue Sep 24 04:48:11 CEST 2019


I would argue that the focus of these functions is the maps, not the
lists they happen to be inside.

Perhaps the whole thing is inside out.  Perhaps what's really needed
is something that says
 - here is a list of maps and a key
 - give me a map of lists and a list
 If {M,R} = maps:transpose(Ms, K)
 then R is the filter of Ms by the condition "does not have key K"
 and M is a map from V to the filter of Ms by the condition "has V as
value for key K".
Only do the linear scan once.

On Tue, 24 Sep 2019 at 00:18, Vance Shipley <vances@REDACTED> wrote:
>
> On Mon, Sep 23, 2019 at 7:45 PM Richard O'Keefe <raoknz@REDACTED> wrote:
> > Keep the function names the same but put them in another module, say 'maps:'.
>
> I would argue that as functions which operate on lists they belong in
> the lists module.
>
> --
>      -Vance
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list