Module

Pha.Random

Package
purescript-pha
Repository
gbagan/purescript-pha

#Random Source

#randomNumber Source

randomNumber :: Random Number

generate a random number in the range [0, 1)

#randomInt Source

randomInt :: Int -> Random Int

generate a random integer in the range [0, n - 1]

#randomBool Source

randomBool :: Random Boolean

generate a random boolean

#shuffle Source

shuffle :: forall a. Array a -> Random (Array a)

randomly shuffle an array

#sample Source

sample :: forall a. Array a -> Random (Maybe a)

randomly select an element from the array

#RandomF Source

data RandomF a

Constructors

Instances