Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- type Prob = Rational
- newtype Dist a = D {}
- type Hyper a = Dist (Dist a)
- fmap :: Ord b => (a -> b) -> Dist a -> Dist b
- return :: Ord a => a -> Dist a
- point :: Ord a => a -> Dist a
- (>>=) :: Ord b => Dist a -> (a -> Dist b) -> Dist b
- join :: Ord a => Hyper a -> Dist a
- uniform :: Ord a => [a] -> Dist a
- choose :: Ord a => Prob -> a -> a -> Dist a
- unpackD :: Dist a -> Map a Prob
- reduction :: Dist a -> Dist a
- weight :: Dist a -> Prob
Documentation
Distribution data type.
return :: Ord a => a -> Dist a Source #
Top-level return function for distributions. Creates a singleton distribution.
(>>=) :: Ord b => Dist a -> (a -> Dist b) -> Dist b Source #
Top-level bind function for distributions.
uniform :: Ord a => [a] -> Dist a Source #
Construct a discrete distribution from a nonempty list of elements, assigning the same probability to each element.