rng-utils

RNG within an IORef for convenient concurrent use

https://bitbucket.org/soostone/rng-utils

Version on this page:0.3.0
LTS Haskell 23.2:0.3.1
Stackage Nightly 2025-01-04:0.3.1
Latest on Hackage:0.3.1

See all snapshots rng-utils appears in

BSD-3-Clause licensed by Ozgun Ataman, Snap Framework Authors
This version can be pinned in stack with:rng-utils-0.3.0@sha256:a5a0075b05b92ea1b210064a48da03a55dc200e20c1b0ac539ef61d52d248aea,1564

Module documentation for 0.3.0

Changes

0.3.0

  • Switch to IORef instead of MVar. This should provide better performance under high contention.
  • Swap out internal RNG for System.Random. It turns out that the gains to be had by using mwc-random are outshadowed by the mutation inherent to this library, so it is preferable to leverage System.Random which appears to be more commonly used and has better coverage of types to generate.
  • Add rngRIO and rngIO convenience functions for generating values.