marvin-0.0.6: A modular chat bot

Copyright(c) Justus Adam 2016
LicenseBSD3
Maintainerdev@justus.science
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

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 :: (IsSequence s, Index s ~ Int, MonadIO m) => s -> m (Element s) 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.