fused-effects-mwc-random: High-quality random number generation as an effect.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

This package wraps the mwc-random package and provides a convenient interface to invoke its functions from an effect stack.

[Skip to Readme]


Change log CHANGELOG.md
Dependencies base (>=4.10 && <4.15), fused-effects (>=1.1 && <1.2), mwc-random (>=0.13.6 && <0.15), primitive (>=0.6.4 && <0.8), template-haskell (>=2.12), transformers (>=0.5.2 && <0.6), vector (>=0.12 && <0.13) [details]
License BSD-3-Clause
Copyright 2020 Patrick Thomson
Author Patrick Thomson
Maintainer patrickt@github.com
Category Control
Home page https://github.com/fused-effects/fused-effects-mwc-random
Bug tracker https://github.com/fused-effects/fused-effects-mwc-random/issues
Source repo head: git clone https://github.com/fused-effects/fused-effects-mwc-random.git
Uploaded by patrick_thomson at 2020-10-05T17:37:15Z


[Index] [Quick Jump]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Readme for fused-effects-mwc-random-

[back to package description]


Hackage BSD3 license

High-quality uniformly-distributed pseudorandom number generation as an effect.

This library provides a Random effect that piggybacks atop the mwc-random package, which produces high-quality random numbers in efficient time. A carrier type (Control.Carrier.Random.Lifted) encapsulates generator state and provides a convenient API to invoke system random number generation or pass a predefined seed. The mwc-random package is finely tuned; as such, this package should be an industrial-strength source of random numbers, suitable for tight loops.

Please note that the MWC-256 algorithm that underlies mwc-random is not cryptographically secure and should not be used for such purposes. Crypto code should use cryptonite, as I'm sure you already know.

For more advanced users, there exists also a module (Control.Carrier.Random.Instances) that provides the orphan instances required to use most fused-effect stacks with the PrimMonad machinery that powers mwc-random. This module is most useful when porting monad transformer stacks that already use the mwc-random API, or if you need to drop into the native mwc-random API.