Portability | Multi-parameter type class with functional dependency |
---|---|

Safe Haskell | Safe |

Language | Haskell98 |

Abstract interface to probabilistic objects like random generators and probability distributions. It allows to use the same code both for computing complete distributions and for generating random values according to the distribution. The latter one is of course more efficient and may be used for approximation of the distribution by simulation.

Maybe a better name is `Experiment`

.

## Synopsis

- class Monad obj => C prob obj | obj -> prob where
- type Spread obj a = [a] -> obj a
- shape :: (C prob obj, Fractional prob) => (prob -> prob) -> Spread obj a
- linear :: (C prob obj, Fractional prob) => Spread obj a
- uniform :: (C prob obj, Fractional prob) => Spread obj a
- negExp :: (C prob obj, Floating prob) => Spread obj a
- normal :: (C prob obj, Floating prob) => Spread obj a
- enum :: (C prob obj, Floating prob) => [Int] -> Spread obj a
- relative :: (C prob obj, Floating prob) => [prob] -> Spread obj a

# Documentation

class Monad obj => C prob obj | obj -> prob where Source #

fromFrequencies :: [(a, prob)] -> obj a Source #

## Instances

C Double T Source # | |

Defined in Numeric.Probability.Object fromFrequencies :: [(a, Double)] -> T a Source # | |

Fractional prob => C prob (T prob) Source # | |

Defined in Numeric.Probability.Object fromFrequencies :: [(a, prob)] -> T prob a Source # |