Fast, high quality pseudo random number generation

Version on this page:
LTS Haskell 11.1:
Stackage Nightly 2018-03-18:
Latest on Hackage:

See all snapshots mwc-random appears in

BSD3 licensed and maintained by Bryan O'Sullivan

Module documentation for

Efficient, general purpose pseudo-random number generation

This package provides the System.Random.MWC module, a Haskell library for generating high-quality pseudo-random numbers in a space- and time-efficient way.

Get involved!

Please report bugs via the github issue tracker.

Master git git repository:

  • git clone git://

There's also a Mercurial mirror:

  • hg clone

(You can create and contribute changes using either Mercurial or git.)


This library is written and maintained by Bryan O'Sullivan, .


Changes in

  • tablePoisson now can handle λ>1923, see #59 for details. That required intoduction of dependency on math-functions.

Changes in

  • logCategorical added

Changes in

  • withSystemRandom uses RtlGenRandom for seeding generator on windows

Changes in

  • primitive-0.6 compatibility

Changes in

  • Monadic variant of vector shuffle added: uniformShuffleM

  • Context on uniformShuffle loosened

Changes in

  • Fixed crash during gen. initialization on Windows when stderr is not available (#36).

Changes in

  • Generators for beta, Bernoully, Dirichlet and categorical distributions added.

  • Functions for generating random shuffles added.

Changes in

  • GHC 7.9 support

Changes in

  • Long standing performance problem in normal distribution fixed (#16)

Changes in

  • createSystemRandom added

Changes in

  • Workaround for GHC bug 8072 (bug 25). GHC 7.6 on 32-bit platrofms is affected.

  • Generators for truncated exponential and geometric distributions added.

Changes in

  • Fucntion asGenIO and asGenST added.

  • Generation of discrete random variates using condensed tables methed. Tables for Poisson and binomial distributions are provided.

comments powered byDisqus