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 <[email protected]> wrote:
> Count by is excellent. Better than either of the alternatives.
>
> -bt
>
> On Fri, Oct 4, 2019 at 8:55 PM José Valim <[email protected]>
> 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 [email protected].
> > 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/20191006010906.4e03cae8%40localhostx.