(i.e. a set of values where all elements outside the set have zero chance of being sampled)
- expectation of a function over the distribution
(e.g. the probability of selecting element
Aby evaluating the function
f(x) = 1if
Contrast the F# implementation with the Scala implementation. The Scala implementation closely follows the F# one, except for one major frustration: the type inference is not as powerful in Scala, as all function arguments must be declared.
Perhaps, I am missing a few tricks because I am new to Scala. If anyone has any suggestions for improving the Scala implementation, please share.
Cross-posted to the Scala wiki.