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

[ bsd3, control, library ] [ Propose Tags ] [ Report a vulnerability ]

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


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.10 && <4.16), 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]
Tested with ghc ==8.2.2, ghc ==8.4.4, ghc ==8.6.5, ghc ==8.8.1, ghc ==8.10.1, ghc ==9.0.1
License BSD-3-Clause
Copyright 2020 Patrick Thomson
Author Patrick Thomson
Maintainer patrickt@github.com
Revised Revision 1 made by patrick_thomson at 2021-10-04T20:36:57Z
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
Downloads 207 total (2 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

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.