Module
Control.Monad.Eff.Random
- Package
- purescript-random
- Repository
- purescript/purescript-random
#randomInt Source
randomInt :: forall e. Int -> Int -> Eff (random :: RANDOM | e) Int
Takes a range specified by low
(the first argument) and high
(the
second), and returns a random integer uniformly distributed in the closed
interval [low, high]
. It is unspecified what happens if low > high
,
or if either of low
or high
is not an integer.
For example:
randomInt 1 10 >>= Console.print
will print a random integer between 1 and 10.
#randomRange Source
randomRange :: forall e. Number -> Number -> Eff (random :: RANDOM | e) Number
Returns a random number between a minimum value (inclusive) and a maximum
value (exclusive). It is unspecified what happens if maximum < minimum
.
For example:
randomRange 1.0 2.0 >>= Console.print
will print a random number between 1 and 2.
- Modules
- Control.
Monad. Eff. Random