TRandom
Context
Models
Signature
interface TRandom {
readonly [TRandomTypeId]: typeof TRandomTypeId;
readonly next: STM<number>;
readonly nextBoolean: STM<boolean>;
readonly nextInt: STM<number>;
nextIntBetween(min: number, max: number): STM<number>;
nextRange(min: number, max: number): STM<number>;
shuffle<A>(elements: Iterable<A>): STM<Array<A>>;
}Random
Returns the next number from the pseudo-random number generator.
Signature
declare const next: STM.STM<number, never, TRandom>;nextBoolean
Added in v2.0.0
Source
Returns the next boolean value from the pseudo-random number generator.
Signature
declare const nextBoolean: STM.STM<boolean, never, TRandom>;Returns the next integer from the pseudo-random number generator.
Signature
declare const nextInt: STM.STM<number, never, TRandom>;nextIntBetween
Added in v2.0.0
Source
Returns the next integer in the specified range from the pseudo-random number generator.
Signature
declare const nextIntBetween: (low: number, high: number) => STM.STM<number, never, TRandom>;Returns the next number in the specified range from the pseudo-random number generator.
Signature
declare const nextRange: (min: number, max: number) => STM.STM<number, never, TRandom>;Uses the pseudo-random number generator to shuffle the specified iterable.
Signature
declare const shuffle: <A>(elements: Iterable<A>) => STM.STM<Array<A>, never, TRandom>;Symbols
TRandomTypeId
Added in v2.0.0
Source
Signature
declare const TRandomTypeId: unique symbol;TRandomTypeId type
Added in v2.0.0
Source
Signature
type TRandomTypeId = typeof TRandomTypeId;
The "live"
TRandomservice wrapped into aLayer.