Copyright | (c) Justus Adam 2016 |
---|---|

License | BSD3 |

Maintainer | dev@justus.science |

Stability | experimental |

Portability | POSIX |

Safe Haskell | None |

Language | Haskell2010 |

- randomVal :: (MonadIO m, Random a) => m a
- randomValFromRange :: (MonadIO m, Random a) => (a, a) -> m a
- randomFrom :: MonadIO m => [e] -> m e
- module System.Random

# 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`

.

module System.Random