Logo Orsak

Random Module

Effects for generating random numbers through an IRandomProvider.

Functions and values

Function or value Description

next min max

Full Usage: next min max

Parameters:
    min : int - The inclusive lower bound.
    max : int - The exclusive upper bound.

Returns: Effect<'a, int, 'b>
Type parameters: 'a, 'b (requires :> Orsak.IRandomProvider)

An effect that generates a random integer from min, inclusive, to max, exclusive.

min : int

The inclusive lower bound.

max : int

The exclusive upper bound.

Returns: Effect<'a, int, 'b>
Example

 let rollDie () = Random.next 1 7
val rollDie: unit -> 'a

nextDouble ()

Full Usage: nextDouble ()

Parameters:
    () : unit

Returns: Effect<'a, float, 'b>
Type parameters: 'a, 'b (requires :> Orsak.IRandomProvider)

An effect that generates a random floating-point number that is greater than or equal to 0.0, and less than 1.0.

() : unit
Returns: Effect<'a, float, 'b>

Type something to start searching.