<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 25, 2019 at 2:03 PM Jesper Louis Andersen <<a href="mailto:jesper.louis.andersen@gmail.com">jesper.louis.andersen@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div><div style="font-family:arial,helvetica,sans-serif">Thinking out loud, I think it might be beneficial to look at two additions:</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">lists:member - because length(..) is in the set of Valid GuardSeqs and is O(n)</div><div style="font-family:arial,helvetica,sans-serif">maps:is_key</div><div style="font-family:arial,helvetica,sans-serif">maps:get</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">The latter map variants are arguably even stronger since they have good lookup time, even for very large maps. Writing maps:is_key(X, #{ a => true, b => true }) should be fast and since it is a literal, it can be optimized in a number of ways by the compiler.</div><br></div></div></div></blockquote><div><br></div><div>OTP-21 includes the new BIFs erlang:map_get(Key, Map) and erlang:map_size(Map) for these reasons. Only lists:member is missing. <br></div></div></div>