Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compact function sorts by probability #353

Open
gaurav-arya opened this issue Jul 14, 2024 · 1 comment
Open

compact function sorts by probability #353

gaurav-arya opened this issue Jul 14, 2024 · 1 comment

Comments

@gaurav-arya
Copy link

The docstring of compact states that result will be "sorted ascendingly according to values", but it seems like there is a sortOn (Down . snd) in the code that causes the result to actually be sorted in descending order of probability.

compact = sortOn (Down . snd) . Map.toAscList . Map.fromListWith (+)

@reubenharry
Copy link
Contributor

Yep, good catch! Feel free to submit a PR for the docstring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants