IdrisDoc: Control.ST.Random

# Control.ST.Random

Random : Type
getRandom : (rnd : Var) -> ST m Integer [rnd ::: Random]
rndFin : (rnd : Var) -> (k : Nat) -> ST m (Fin (S k)) [rnd ::: Random]

  Generate a random number in `Fin (S k)`

  Note that rndFin k takes values 0, 1, ..., k.

rndInt : (rnd : Var) -> Integer -> Integer -> ST m Integer [rnd ::: Random]

  Generates a random Integer in a given range

rndSelect : (rnd : Var) -> (xs : List a) -> {auto ok : NonEmpty xs} -> ST m a [rnd ::: Random]

  Select a random element from a non-empty list

rndSelect' : (rnd : Var) -> Vect (S k) a -> ST m a [rnd ::: Random]

  Select a random element from a vector