Generic basis for random number generators

Version on this page:
LTS Haskell 19.33:
Stackage Nightly 2022-03-17:
Latest on Hackage:

See all snapshots random-source appears in

LicenseRef-PublicDomain licensed and maintained by James Cook
This version can be pinned in stack with:random-source-,3234

Random number generation based on entropy sources able to produce a small but well-defined set of primitive variates. Also includes facilities for "completing" partial implementations, making it easy to define new entropy sources in a way that is naturally forward-compatible.


  • Changes in Revert changes (which accidentally removed the Random.Source.PureMT module and added an overlapping instance).

  • Changes in Add MonadRandom instance for MWC generator and RWS transformer.

  • Changes in Fixed overzealous fix in The people responsible for sacking the people who have been sacked, etc., have been sacked.

  • Changes in Renamed some internal modules and accidentally some external ones too. Whoops. Please don’t use this version, it will only end in tears.

  • Changes in Fixed a typo that broke building with MTL-1

  • Changes in Fixes for GHC’s deprecation of Foreign.unsafePerformIO

  • Changes in Fixes for GHC 7.2.*’s crazy Template Haskell changes.