[elixir-core:10835] [Proposal] Add Access.get_lazy/3

2022-03-08 Thread Tyler Young
There's been advice in the community to avoid unnecessarily locking yourself into a particular data structure by using Access.get/2 rather the Map or Keyword versions of get/2. In line with that, it would be nice if there were a corresponding

Re: [elixir-core:10833] [Proposal] Add `List.pop/2`

2022-03-08 Thread Max Veytsman
Oh I completely agree! I used MapSet because it has clean semantics for the problem domain, I expect with small datasets there won't be any performance difference. But looking at my code now I'm not using pop (because `MapSet.pop/2` ecause this doesn't exist, so this may not be helpful to the

Re: [elixir-core:10833] [Proposal] Add `List.pop/2`

2022-03-08 Thread Ben Wilson
I would benchmark to make sure that you're actually gaining something. If you are relying on it to be small, then at that specific size a list might also just be fine, and you won't be relying on behavior that could change in a future release. On Monday, March 7, 2022 at 11:49:06 AM UTC-5 Max