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

Method nextIntBetween

packages/effect/src/internal/stm/tRandom.ts:103–105  ·  view source on GitHub ↗
(low: number, high: number)

Source from the content-addressed store, hash-verified

101 return core.flatMap(this.next, (n) => core.succeed((max - min) * n + min))
102 }
103 nextIntBetween(low: number, high: number): STM.STM<number> {
104 return withState(this.state, randomIntegerBetween(low, high))
105 }
106 shuffle<A>(elements: Iterable<A>): STM.STM<Array<A>> {
107 return shuffleWith(elements, (n) => this.nextIntBetween(0, n))
108 }

Callers 1

shuffleMethod · 0.95

Calls 2

withStateFunction · 0.85
randomIntegerBetweenFunction · 0.85

Tested by

no test coverage detected