Skip to content

Conversation

QWYNG
Copy link
Contributor

@QWYNG QWYNG commented Sep 30, 2019

Hi! Thank you for a great programing language.
This is a suggestion and a PR in one.

Add tally function like Rubys tally.
https://bugs.ruby-lang.org/issues/11076

Let me know if there's anything to be clarified/updated.
Hope it makes sense!

@josevalim
Copy link
Member

Thank you @QWYNG! The best would be to have a discussion about this in the Elixir Core Mailing list. In particular, I would love to know if other languages provide this and under which name.

@josevalim
Copy link
Member

Closing this for now until pending ML discussion. We can always reopen it later!

@josevalim josevalim closed this Sep 30, 2019
@wojtekmach
Copy link
Member

To me this is one of these things that doesn't come up that often but when it does it'd be extremely convenient to have such function.

I like Clojure's name for this: frequencies.

user=> (frequencies [:a :b :b :c :c :c])
{:a 1, :b 2, :c 3}

Looking forward to the discussion on the ML.

@QWYNG
Copy link
Contributor Author

QWYNG commented Sep 30, 2019

@josevalim @wojtekmach
thanks! I will post this to ML!

@QWYNG QWYNG deleted the enum-tally branch October 5, 2019 00:07
@QWYNG QWYNG restored the enum-tally branch October 5, 2019 00:07
@QWYNG QWYNG mentioned this pull request Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants