 | ProbabilityMonads-0.1.0: Probability distribution monads. | Contents | Index |
|
Data.Probability.Base | Portability | non-portable (newtype deriving) | Stability | experimental |
|
|
|
Description |
Support for probability values.
|
|
Synopsis |
|
|
|
Documentation |
|
class (Eq p, Monoid p) => Probability p where |
The probability of an event occuring. We provide this as a type
class, allowing users of this library to choose among various
representations of probability.
| | Methods | prob :: Rational -> p | Create a probability from a rational number between 0 and 1, inclusive.
| | fromProb :: p -> Rational | Convert a probability to a rational number.
| | pnot :: p -> p | Given the probability of an event occuring, calculate the
probability of the event not occuring.
| | padd :: p -> p -> p | Given the probabilities of two disjoint events, calculate the
probability of either event occuring.
| | pmul :: p -> p -> p | Given the probabilities of two indepedent events, calculate the
probability of both events occuring.
|
| | Instances | |
|
|
prob :: Probability p => Rational -> p |
Create a probability from a rational number between 0 and 1, inclusive.
|
|
fromProb :: Probability p => p -> Rational |
Convert a probability to a rational number.
|
|
pnot :: Probability p => p -> p |
Given the probability of an event occuring, calculate the
probability of the event not occuring.
|
|
padd :: Probability p => p -> p -> p |
Given the probabilities of two disjoint events, calculate the
probability of either event occuring.
|
|
pmul :: Probability p => p -> p -> p |
Given the probabilities of two indepedent events, calculate the
probability of both events occuring.
|
|
Produced by Haddock version 0.8 |