Random
Provides basic operations on generator functions.
Functions and values
Function or value | Description |
bind(binder generator)
Signature: binder:('a -> GeneratorFunction<'b>) -> generator:GeneratorFunction<'a> -> GeneratorFunction<'b>
Type parameters: 'a, 'b |
Invokes a function on a random function. |
get(generator arg2)
Signature: generator:GeneratorFunction<'a> -> PrngState -> 'a
Type parameters: 'a |
Generates a random number. |
identity(generator)
Signature: generator:GeneratorFunction<'a> -> GeneratorFunction<'a>
Type parameters: 'a |
Generates a random number by and returns the value. |
map(transformation generator)
Signature: transformation:('a -> 'b) -> generator:GeneratorFunction<'a> -> GeneratorFunction<'b>
Type parameters: 'a, 'b |
Generates a random number by and returns a transformed value by function. |
map2(...)
Signature: transformation:('a1 -> 'a2 -> 'b) -> generator1:GeneratorFunction<'a1> -> generator2:GeneratorFunction<'a2> -> GeneratorFunction<'b>
Type parameters: 'a1, 'a2, 'b |
Generates a random number by using two random numbers. |
map3(...)
Signature: transformation:('a1 -> 'a2 -> 'a3 -> 'b) -> generator1:GeneratorFunction<'a1> -> generator2:GeneratorFunction<'a2> -> generator2:GeneratorFunction<'a3> -> GeneratorFunction<'b>
Type parameters: 'a1, 'a2, 'a3, 'b |
Generates a random number by using three random numbers. |
merge(generators)
Signature: generators:GeneratorFunction<'a> list -> GeneratorFunction<'a list>
Type parameters: 'a |
Merges random stream list into one. |
mergeWith(f)
Signature: f:('a list -> 'b) -> GeneratorFunction<'a> list -> GeneratorFunction<'b>
Type parameters: 'a, 'b |
Merges random stream list into one and then apply the specified function. |
next(generator arg2)
Signature: generator:GeneratorFunction<'a> -> PrngState -> 'a * PrngState
Type parameters: 'a |
Generates a random number with the next random state. |
singleton(x)
Signature: x:'a -> GeneratorFunction<'a>
Type parameters: 'a |
Always returns the specified value. |
transformBy(transformation generator)
Signature: transformation:('a -> 'b) -> generator:GeneratorFunction<'a> -> GeneratorFunction<'b>
Type parameters: 'a, 'b |
Generates a random number by and returns a transformed value by function. |
transformBy2(...)
Signature: transformation:('a1 -> 'a2 -> 'b) -> generator1:GeneratorFunction<'a1> -> generator2:GeneratorFunction<'a2> -> GeneratorFunction<'b>
Type parameters: 'a1, 'a2, 'b |
Generates a random number by using two random numbers. |
transformBy3(...)
Signature: transformation:('a1 -> 'a2 -> 'a3 -> 'b) -> generator1:GeneratorFunction<'a1> -> generator2:GeneratorFunction<'a2> -> generator2:GeneratorFunction<'a3> -> GeneratorFunction<'b>
Type parameters: 'a1, 'a2, 'a3, 'b |
Generates a random number by using three random numbers. |
zip(generator1 generator2)
Signature: generator1:GeneratorFunction<'a1> -> generator2:GeneratorFunction<'a2> -> GeneratorFunction<'a1 * 'a2>
Type parameters: 'a1, 'a2 |
Merges two random streams into one. |
zip3(generator1 generator2 generator3)
Signature: generator1:GeneratorFunction<'a1> -> generator2:GeneratorFunction<'a2> -> generator3:GeneratorFunction<'a3> -> GeneratorFunction<'a1 * 'a2 * 'a3>
Type parameters: 'a1, 'a2, 'a3 |
Merges three random streams into one. |