Random number generators
The libraries in this subsection are as follows:
MonadRandom
: Simple monadic interface for supplying random numbers. UsesSystem.Random
. It's rather slow and not very secure.mwc-random
: Very fast pseudo-random number generation. Probably not cryptographically secure.random-fu
: Good support for sampling a wide range of different distributions. Good quality but not terribly slow either.mersenne-random
: Pseudo-random numbers using a Mersenne Twister. Probably fastest RNG for Haskell when SIMD is supported.
Random numbers have multiple applications, from simulations to cryptography. Random number generators come with different trade-offs that suit different applications. Others are very fast and not really that random, while others are slower but cryptographically secure.
Haskell doesn't have a shortage of pseudo-random RNG libraries. Cryptographically secure random numbers are hard, however; your best bet is probably in HsOpenSSL
or cryptonite
.
For pseudo-random number...