úÎ!ÿ      (c) William Yager 2015MIT%will (dot) yager (at) gmail (dot) com provisionalportableSafe•Dist6A probability distribution with probabilities of type p and outcomes/events of type o.DistNReweights the probabilities in the distribution based on the given function. n*log(n)Dist2The sum of all probabilities in the distribution. O(1)Dist1Normalizes the distribution. After normalizing,  distribution is 1. O(n)Dist4Insert an outcome into the distribution. Inserting (o,p1) and (o,p2)8 results in the same sampled distribution as inserting  (o,p1+p2).  O(log(n)) amortized.DistThe empty distribution. O(1)Dist  O(n*log(n))Dist  O(n*log(n))Dist%Doesn't bother to remove duplicates.  O(n*log(n)) amortized.Dist%Doesn't bother to eliminate repeats. O(n)DistâA right-associative fold on the tree structure, including the probabilities. Note that outcomes may be repeated within the data structure. If you want identical outcomes to be lumped together, fold on the list produced by . O(n). DistOCreates a new distribution that's the joint distribution of the two provided.  O(nm*log(nm)) amortized. Dist^Creates a new distribution by summing the probabilities of the outcomes in the two provided. O((n+m)log(n+m)) amortized. Dist­Given an outcome, returns the probability. Note that the probability is not always normalized. If you want the probability to be in the 0-1 range, you should divide it by  cumulate dist. (the sum of the probability of all outcomes) Dist;Take a sample from the distribution. Can be used with e.g. evalRand or  evalRandIO from Control.Monad.Random.  O(log(n)); for a uniform distribution (worst case), but approaches O(1)# with less balanced distributions. DistYA series of tests on the internal structure of the distribution. For debugging purposes.         !Dist-0.4.2-IkKTBklCSJjKJWVaXkm03Z Numeric.Probability.Distribution Distributionreweightcumulate normalizeinsertemptyfromListtoList foldrWithPjointsumlookupsample invariants$fShowDistribution fromUniqList toRepeatList