Package

purescript-pseudo-random

Repository
opyapeus/purescript-pseudo-random
License
MIT
Uploaded by
opyapeus
Published on
2018-09-11

Build status

A pseudo random value generator like System.Random in Haskell.

This library depends on purescript-lcg using linear congruential generator algorithm (LCG).

Examples

> 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

Documentation