Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 0.4% on hackage.haskell.org
Top 0.1% downloads on hackage.haskell.org
Top 0.1% dependent packages on hackage.haskell.org
Top 0.1% dependent repos on hackage.haskell.org
Top 1.3% docker downloads on hackage.haskell.org

hackage.haskell.org : random

This package provides basic pseudo-random number generation, including the ability to split random number generators. In pure code, use System.Random.uniform and System.Random.uniformR from System.Random to generate pseudo-random numbers with a pure pseudo-random number generator like System.Random.StdGen. As an example, here is how you can simulate rolls of a six-sided die using System.Random.uniformR: See System.Random for more details. In monadic code, use System.Random.Stateful.uniformM and System.Random.Stateful.uniformRM from System.Random.Stateful to generate pseudo-random numbers with a monadic pseudo-random number generator, or using a monadic adapter. As an example, here is how you can simulate rolls of a six-sided die using System.Random.Stateful.uniformRM: The monadic adapter System.Random.Stateful.runStateGen_ is used here to lift the pure pseudo-random number generator pureGen into the System.Random.Stateful.StatefulGen context. The monadic interface can also be used with existing monadic pseudo-random number generators. In this example, we use the one provided in the mwc-random package: See System.Random.Stateful for more details.

Registry - JSON
purl: pkg:hackage/random
Keywords: bsd3, library, system
License: BSD-3-Clause
Latest release: over 2 years ago
First release: over 16 years ago
Dependent packages: 230
Dependent repositories: 5,963
Downloads: 431,505 total
Docker dependents: 1
Docker downloads: 16
Last synced: 6 days ago

    Loading...
    Readme
    Loading...