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

Method constructor

packages/effect/src/internal/stm/tRandom.ts:90–94  ·  view source on GitHub ↗
(readonly state: TRef.TRef<Random.PCGRandomState>)

Source from the content-addressed store, hash-verified

88class TRandomImpl implements TRandom.TRandom {
89 readonly [TRandomTypeId]: TRandom.TRandomTypeId = TRandomTypeId
90 constructor(readonly state: TRef.TRef<Random.PCGRandomState>) {
91 this.next = withState(this.state, randomNumber)
92 this.nextBoolean = core.flatMap(this.next, (n) => core.succeed(n > 0.5))
93 this.nextInt = withState(this.state, randomInteger)
94 }
95
96 next: STM.STM<number>
97 nextBoolean: STM.STM<boolean>

Callers

nothing calls this directly

Calls 1

withStateFunction · 0.85

Tested by

no test coverage detected