Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Rand

/// generate a random number between #start and #end (exclusive)
/// every time any argument updates, #clock or a bound. The bounds
/// default to 0.0 and 1.0, so an integer range gives both. An empty
/// range produces nothing.
val rand: fn<'a: [Int, Float] + Singleton>(?#start:'a, ?#end:'a, #clock:Any) -> 'a;

/// pick a random element from the array and return it. Update
/// each time the array updates. If the array is empty return
/// nothing.
val pick: fn(a: Array<'a>) -> 'a;

/// return a shuffled copy of a
val shuffle: fn(a: Array<'a>) -> Array<'a>;