MonadRandom icon indicating copy to clipboard operation
MonadRandom copied to clipboard

`weighted` does not complain about negative weights

Open luqui opened this issue 4 years ago • 1 comments

If I do

weighted [(1,-1), (2, -2)]

Sometimes it will give a mysterious error head: empty list. It should say that negative weights are not allowed instead.

luqui avatar Feb 25 '20 00:02 luqui

Hi @luqui , which version of MonadRandom are you using? This got improved in the most recent 0.5.1.2 release, see https://github.com/byorgey/MonadRandom/issues/44 . I'm open to suggestions for further improvement.

byorgey avatar Feb 25 '20 03:02 byorgey