HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulecryptonite-0.30Haskell2010

Crypto.Random

  • 4 types
  • 2 classes
  • 10 values
  • Packagecryptonite-0.30
  • Exports16
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceChaChaDRG.hs

Deterministic instances

3 declarations
newtypenewtype ChaChaDRG
#

ChaCha Deterministic Random Generator

Instances2NFData, DRG
  • NFData ChaChaDRGDefined in cryptonite-0.30 · Crypto.Random.ChaChaDRG
  • DRG ChaChaDRGDefined in cryptonite-0.30 · Crypto.Random.ChaChaDRG
datadata SystemDRG
#

A referentially transparent System representation of the random evaluated out of the system.

Holding onto a specific DRG means that all the already evaluated bytes will be consistently replayed.

There's no need to reseed this DRG, as only pure entropy is represented here.

Instances1DRG
  • DRG SystemDRGDefined in cryptonite-0.30 · Crypto.Random.SystemDRG

Seed

4 declarations

Deterministic Random class

7 declarations

Create a new DRG from 5 Word64.

This is a convenient interface to create deterministic interface for quickcheck style testing.

It can also be used in other contexts provided the input has been properly randomly generated.

Note that the Arbitrary instance provided by QuickCheck for Word64 does not have a uniform distribution. It is often better to use instead arbitraryBoundedRandom.

System endianness impacts how the tuple is interpreted and therefore changes the resulting DRG.

classclass DRG gen where
#

A Deterministic Random Generator (DRG) class

Methods

Instances2DRG
  • DRG ChaChaDRGDefined in cryptonite-0.30 · Crypto.Random.ChaChaDRG
  • DRG SystemDRGDefined in cryptonite-0.30 · Crypto.Random.SystemDRG

Random abstraction

2 declarations
newtypenewtype MonadPseudoRandom gen a
#

A simple Monad class very similar to a State Monad with the state being a DRG.

Instances4Monad, Functor, Applicative, MonadRandom