[Haskell-cafe] ANN: monte-carlo version 0.3
Patrick Perry
patperry at gmail.com
Thu Sep 16 17:34:44 EDT 2010
monte-carlo is a haskell library providing a monad and associated monad transformer for computing with quasi-random numbers. It provides a high-level interface to the distributions supported by the GNU Scientific Library (currently just uniform, normal, exponential, Poisson, Levy, but others are easy to add). You can see examples of the library in action at http://github.com/patperry/hs-monte-carlo/tree/master/examples/ . Hackage documentation is at http://hackage.haskell.org/package/monte-carlo .
A few blog posts describe an older version of the library, but beware the API has changed slightly, and these examples require some modification:
http://ptrckprry.com/blog/2008/08/26/a-monte-carlo-monad-for-haskell/ (see examples/Pi.lhs)
http://ptrckprry.com/blog/2008/12/31/monte-carlo-poker-odds/ (see examples/Poker.hs)
The changes since the last release are listed below. I welcome feedback, bug reports, and contributions.
Patrick
Changes since version 0.2.
* Add strict versions of sampleSubset, sampleIntSubset, and shuffleInt.
* Port to vector-0.6.0.
* Add Exponential and Levy alpha-Stable distributions.
* Add Summary.Bool for indicators.
* Move Summary to Data.Summary
* Introduce `repeatMC`, which produces an infinite (lazy) stream of values, and
`replicateMC`, which produces a lazy list of specified length.
* Remove `repeatMC/repeatMCWith`.
* Build fix for 6.8.2 from Robert Gunst.
* The function `sample`, `sampleWithWeights`, `sampleSubset`, and
`shuffle` no longer require that you explicitly pass in the length.
* The pure RNG is now a newtype, so you can't use the functions from
GLS.Random.Gen on it anymore.
* The internals of the monad have been cleaned up. IO is used internally
instead of `seq` calls and `unsafePerformIO` everywhere. This results in
a modest performance boost.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100916/6a8701c4/attachment.html
More information about the Haskell-Cafe
mailing list