marvin-0.1.0: A modular chat bot

Marvin.Util.Random

Description

Synopsis

# Documentation

randomVal :: (MonadIO m, Random a) => m a Source #

Generate a random value. For more information see random

randomValFromRange :: (MonadIO m, Random a) => (a, a) -> m a Source #

Generate a random value frbounded by a range. See randomR for how the range works.

randomFrom :: MonadIO m => [e] -> m e Source #

Get a random value out of an integer indexed sequence, like (Vector, '[a]', Seq or Set) This uses the sequences length and therefore does not terminate for infinite sequences.

Uses the global random number generator.

Usable in all IO capable monads, such as BotReacting and ScriptDefinition.