Open gaurav-arya opened 2 months ago
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)
https://github.com/tweag/monad-bayes/blob/14faeb72ba7a043e28e8f350813b50d3397caa1b/src/Control/Monad/Bayes/Enumerator.hs#L94
Yep, good catch! Feel free to submit a PR for the docstring
The docstring of
compact
states that result will be "sorted ascendingly according to values", but it seems like there is asortOn (Down . snd)
in the code that causes the result to actually be sorted in descending order of probability.https://github.com/tweag/monad-bayes/blob/14faeb72ba7a043e28e8f350813b50d3397caa1b/src/Control/Monad/Bayes/Enumerator.hs#L94