effect-io-ai

Package: effect
Module: Random

Random.make

Constructs the Random service, seeding the pseudo-random number generator with an hash of the specified seed. This constructor is useful for generating predictable sequences of random values for specific use cases.

Example uses:

Example

import * as assert from "node:assert"
import { Effect, Random } from "effect"

const random1 = Random.make("myseed")
const random2 = Random.make("myseed")

assert.equal(Effect.runSync(random1.next), Effect.runSync(random2.next))

Signature

declare const make: <A>(seed: A) => Random

Source

Since v3.5.0