Creates utility functions based on the [[random]] function, e.g.:
random
const state: AleaState = mkState('123');const nextBool: (state: AleaState) => boolean = nextT(n => n < 0.5);// calling `nextBool(state)` now returns `true` or `false` at random Copy
const state: AleaState = mkState('123');const nextBool: (state: AleaState) => boolean = nextT(n => n < 0.5);// calling `nextBool(state)` now returns `true` or `false` at random
a function to transform a number in the interval [0, 1) to a value of type T
[0, 1)
T
a function that, when invoked with a state, transforms the next pseudo-random number n to a T using the provided function f
n
f
Generated using TypeDoc
Creates utility functions based on the [[
random
]] function, e.g.: