Enum.group_count/2 would be a name that describe better what this function does 
IMO, but it
wouldn't work as Enum.group_by/3 since this one groups by key, and group_count 
would group by
elements ({key, value})

On Sun, 6 Oct 2019 01:09:06 +0700
eksperimental <eksperimen...@autistici.org> wrote:

> The problem I have with Enum.count_by/2 is that I wouldn't be able just by 
> looking at the name to
> tell it apart from Enum.count/2 which takes a function as a second argument
> 
> How will this function work with enumerables other than lists? the way it 
> currently does is
> correct?
> 
>     iex(6)> Enum.tally %{a: 1, b: 2}  
>     %{{:a, 1} => 1, {:b, 2} => 1}
> 
> 
>  On Fri, 4 Oct 2019 21:55:09 -0400
> Bruce Tate <br...@grox.io> wrote:
> 
> > Count by is excellent. Better than either of the alternatives.
> > 
> > -bt
> > 
> > On Fri, Oct 4, 2019 at 8:55 PM José Valim <jose.va...@plataformatec.com.br>
> > wrote:
> >   
> > > So I am not a native speaker, but “tally” sounds very foreign to me. Is it
> > > used frequently? I am afraid an uncommon name won’t help with
> > > readability/discovery. Is there a reason why it is not called count_by? It
> > > seems it was first proposed as such to Ruby. Thank you for the proposal!
> > > --
> > >
> > >
> > > *José Valim*
> > > www.plataformatec.com.br
> > > Skype: jv.ptec
> > > Founder and Director of R&D
> > >
> > > --
> > > 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/CAGnRm4KqUJKyuD0CSe5gTHL761SR6CncKDD1ryTsHTuRWXFN8g%40mail.gmail.com
> > > <https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4KqUJKyuD0CSe5gTHL761SR6CncKDD1ryTsHTuRWXFN8g%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/20191006013131.2145bc91%40localhostx.

Reply via email to