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

[ bsd3, control, library ] [ Propose Tags ]

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


[Skip to Readme]
Versions [faq] 0.1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.10 && <4.15), fused-effects (==1.1.*), 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.*) [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:42Z
Distributions NixOS:0.1.0.0
Downloads 27 total (27 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for fused-effects-mwc-random-0.1.0.0

[back to package description]

fused-effects-mwc-random

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.