MCPcopy Create free account
hub / github.com/Effect-TS/effect / randomWith

Function randomWith

packages/effect/src/Random.ts:57–58  ·  view source on GitHub ↗
(f: (random: typeof Random["Service"]) => A)

Source from the content-addressed store, hash-verified

55}> = random.Random
56
57const randomWith = <A>(f: (random: typeof Random["Service"]) => A): Effect.Effect<A> =>
58 Effect.withFiber((fiber) => Effect.succeed(f(fiber.getRef(Random))))
59
60/**
61 * Generates a random number between 0 (inclusive) and 1 (exclusive).

Callers 4

Random.tsFile · 0.85
nextBetweenFunction · 0.85
nextIntBetweenFunction · 0.85
shuffleFunction · 0.85

Calls 3

getRefMethod · 0.80
fFunction · 0.50
succeedMethod · 0.45

Tested by

no test coverage detected