frequency sounds good! I also have tried to get some data through the production console.
PHP has a similar method https://www.php.net/manual/en/function.array-count-values.php May I update My PR? 2019年10月1日火曜日 7時36分56秒 UTC+9 OvermindDL1: > > I prefer the name `frequency` as well, however I would vote not to include > it. It is trivial enough just type it inline where needed as it as and it > would not be used often-enough to be worth inclusion I think. Perhaps as > another library for now? > > On Monday, September 30, 2019 at 11:35:46 AM UTC-6, Allen Madsen wrote: >> >> I think the problem with including this in the core library is that you >> can end up with very different implementations depending on what your use >> case is. So, if it were included in the standard library, it would need to >> be explicit about when to use it and when not to. >> >> The version provided in the PR is memory inefficient, because it first >> does a group by, which requires it to retain every element in the >> collection. For simple, use cases that may be fine, but if you're streaming >> a large amount of data, you probably only want to keep track of the counts. >> If you're keeping track of the counts, you're probably being inefficient >> speed wise, because you're constantly updating the accumulator map for each >> item in the collection. To do that efficiently, you probably want to use an >> ETS table. But, do you really want an ETS table to be created any time you >> call this function? >> >> Allen Madsen >> http://www.allenmadsen.com >> >> >> On Mon, Sep 30, 2019 at 1:20 PM Paul Byrne <paulgreg...@gmail.com> wrote: >> >>> Most occasions I've needed to do this kind of count, I've been trying to >>> get some data through the production console, rather than it being some >>> business logic, to get a sense of how often some data problem has occurred. >>> >>> Given that I think it's a rather nice addition to the toolbox. It's >>> certainly generic enough, though possibly too niche. >>> >>> Paul >>> >>> On Mon, Sep 30, 2019, 12:57 Wojtek Mach <woj...@wojtekmach.pl> wrote: >>> >>>> As I mentioned on the linked PR, I’m in favor of such feature. I like >>>> how Clojure calls this function: frequencies. Thus if we are considering >>>> Enum.frequencies/1 and/or Enum.frequencies/2, it has my vote. >>>> >>>> To move the proposal forward I think it would be very valuable if you >>>> could survey other programming languages to see if they have such feature >>>> and if so - under what function name. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "elixir-lang-core" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to elixir-l...@googlegroups.com. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/elixir-lang-core/1ACBE99E-BE36-4035-991C-9BD03651048C%40wojtekmach.pl >>>> . >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "elixir-lang-core" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to elixir-l...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/elixir-lang-core/CAL%3D_u%3DLVpD4Gf5Ay_ezX7W%3DFRoB5y31EU%3DLAiOHhTK%2BGSFyzeg%40mail.gmail.com >>> >>> <https://groups.google.com/d/msgid/elixir-lang-core/CAL%3D_u%3DLVpD4Gf5Ay_ezX7W%3DFRoB5y31EU%3DLAiOHhTK%2BGSFyzeg%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/0e4dc6bc-4654-4698-b8a9-cc9b0782bbbc%40googlegroups.com.