<html><head></head><body>If it's all about lists, you've got all you need: lists:search/2 or as previously mentioned lists:dropwhile.<br><br>To me presence of lists:key... functions is a serious legacy which is justified only because there are tons of code using it. I'm glad we don't have all of the 'sofs' functions in 'lists' module.<br>Of course it would be nice to have faster versions than handcrafted functions, but I'd like them to be introduced in a separate module, e.g. list_of_maps.<br><br><div class="gmail_quote">On 24 September 2019 3:32:55 pm AEST, Vance Shipley <vances@motivity.ca> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On Tue, Sep 24, 2019 at 10:48 AM Richard O'Keefe <raoknz@gmail.com> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">I would argue that the focus of these functions is the maps, not the lists they happen to be inside.<br></blockquote><br>In my mind this is all about lists. Think small maps and big lists.<br>That the terms are maps is a detail I have to deal with in processing<br>my lists. I just want the lists module to be orthogonal. If we aren't<br>going to move all the lists:key* functions to a 'records' module<br>(please don't) let's simply add support for the new term type which<br>"replaces" records.<br><br>Your example is certainly all about maps but it doesn't help my use cases.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Perhaps the whole thing is inside out. Perhaps what's really needed<br>is something that says<br> - here is a list of maps and a key<br> - give me a map of lists and a list<br> If {M,R} = maps:transpose(Ms, K)<br> then R is the filter of Ms by the condition "does not have key K"<br> and M is a map from V to the filter of Ms by the condition "has V as<br>value for key K".<br>Only do the linear scan once.<br></blockquote><br></pre></blockquote></div><br>-- <br>Kind regards,<br>Dmitry Belyaev</body></html>