MCPcopy Index your code
hub / github.com/Effect-TS/effect / randomNumber

Function randomNumber

packages/effect/src/internal/stm/tRandom.ts:35–39  ·  view source on GitHub ↗
(state: Random.PCGRandomState)

Source from the content-addressed store, hash-verified

33}
34
35const randomNumber = (state: Random.PCGRandomState): [number, Random.PCGRandomState] => {
36 const prng = new Random.PCGRandom()
37 prng.setState(state)
38 return [prng.number(), prng.getState()]
39}
40
41const withState = <A>(
42 state: TRef.TRef<Random.PCGRandomState>,

Callers

nothing calls this directly

Calls 3

setStateMethod · 0.95
numberMethod · 0.95
getStateMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…