https://github.com/opyapeus/purescript-pseudo-random
A pseudo random value generator like System.Random in Haskell.
https://github.com/opyapeus/purescript-pseudo-random
Last synced: 4 months ago
JSON representation
A pseudo random value generator like System.Random in Haskell.
- Host: GitHub
- URL: https://github.com/opyapeus/purescript-pseudo-random
- Owner: opyapeus
- License: mit
- Created: 2018-09-10T20:27:10.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-05T11:38:32.000Z (over 6 years ago)
- Last Synced: 2026-01-24T06:24:14.579Z (5 months ago)
- Language: PureScript
- Homepage:
- Size: 11.7 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# purescript-pseudo-random
[](https://travis-ci.org/opyapeus/purescript-pseudo-random)
A pseudo random value generator like [System.Random](http://hackage.haskell.org/package/random) in Haskell.
This library depends on [purescript-lcg](https://github.com/purescript/purescript-lcg) using linear congruential generator algorithm (LCG).
## Examples
```PureScript
> import Random.PseudoRandom
> randomRs 0 10 5 (mkSeed 1)
[3,8,1,5,9]
> randomRs 0.0 10.0 5 (mkSeed 1)
[0.00022477936010098986,0.8503244914348818,6.0135260531741785,8.916112770753035,9.679557019695434]
> randomRs true false 5 (mkSeed 1)
[false,false,true,true,true]
> randomRs 'a' 'z' 5 (mkSeed 1)
['p','u','c','l','h']
```
## Installation
```sh
bower install purescript-pseudo-random
```
## Documentation
Module documentation is [published on Pursuit](https://pursuit.purescript.org/packages/purescript-pseudo-random).