The Library allows exact computation with discrete random variables in terms of their distributions by using a monad. The monad is similar to the List monad for non-deterministic computations, but extends the List monad by a measure of probability. Small interface to R plotting.

Changes

Change log for the probability package

0.2.7

  • support random-1.2

0.2.6

  • instance Monad Distribution.T: Remove definition of fail. This turns calls to fail into errors for GHCs prior to the “Monad Fail Proposal”. Formerly it was an empty list, but this was bad since the probabilities in an empty list sum up to zero not one, thus breaking the invariant. Beginning with GHC-8.8 and the “Monad Fail Proposal” you can no longer accidentally call fail, since Distribution.T is not an instance of MonadFail.

  • instance Monad Probability.EitherT: Define MonadFail instance for GHC>=8.8.1.