| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Traq.Data.Probability.Tree
Description
Probabilistic computation monad.
Tree of outcomes representation of a probability distribution.
A tree representation of a probability distributions.
E.g. Distr Double a for real-valued probabilities.
Distr () a for non-deterministic value.
Constructors
| Leaf a | A deterministic value (probability 1) |
| Branch [(probT, Distr probT a)] | A probabilistic choice with at least two outcomes |
Instances
| Alternative Tree # | |
| MonadPlus Tree # | |
| ProbType probT => MonadExp probT (Distr probT) # | |
Defined in Traq.Data.Probability.Tree Methods expectationA :: (Applicative f, RVType probT r) => (a -> f r) -> Distr probT a -> f r # | |
| ProbType probT => MonadProb probT (Distr probT) # | |
| MonadFail (Distr probT) # | |
Defined in Traq.Data.Probability.Tree | |
| Foldable (Distr probT) # | |
Defined in Traq.Data.Probability.Tree Methods fold :: Monoid m => Distr probT m -> m # foldMap :: Monoid m => (a -> m) -> Distr probT a -> m # foldMap' :: Monoid m => (a -> m) -> Distr probT a -> m # foldr :: (a -> b -> b) -> b -> Distr probT a -> b # foldr' :: (a -> b -> b) -> b -> Distr probT a -> b # foldl :: (b -> a -> b) -> b -> Distr probT a -> b # foldl' :: (b -> a -> b) -> b -> Distr probT a -> b # foldr1 :: (a -> a -> a) -> Distr probT a -> a # foldl1 :: (a -> a -> a) -> Distr probT a -> a # toList :: Distr probT a -> [a] # null :: Distr probT a -> Bool # length :: Distr probT a -> Int # elem :: Eq a => a -> Distr probT a -> Bool # maximum :: Ord a => Distr probT a -> a # minimum :: Ord a => Distr probT a -> a # | |
| Traversable (Distr probT) # | |
Defined in Traq.Data.Probability.Tree | |
| Applicative (Distr probT) # | |
Defined in Traq.Data.Probability.Tree | |
| Functor (Distr probT) # | |
| Monad (Distr probT) # | |
| (Read a, Read probT) => Read (Distr probT a) # | |
| (Show a, Show probT) => Show (Distr probT a) # | |
| (Eq a, Eq probT) => Eq (Distr probT a) # | |
| (Ord a, Ord probT) => Ord (Distr probT a) # | |
Defined in Traq.Data.Probability.Tree Methods compare :: Distr probT a -> Distr probT a -> Ordering # (<) :: Distr probT a -> Distr probT a -> Bool # (<=) :: Distr probT a -> Distr probT a -> Bool # (>) :: Distr probT a -> Distr probT a -> Bool # (>=) :: Distr probT a -> Distr probT a -> Bool # | |
flattenAndCompress :: (Num probT, Ord a) => Distr probT a -> Distr probT a #
Flatten a probability tree to one level, and merge equal outcomes.