<commit_before>module Control.Monad.Eff.Random where

import Prelude

import Control.Monad.Eff (Eff())
import Data.Int (toNumber, floor)

-- | The `RANDOM` effect indicates that an Eff action may access or modify the
-- | JavaScript global random number generator, i.e. `Math.random()`.
foreign import data RANDOM :: !

-- | Returns a random number between 0 (inclusive) and 1 (exclusive). This is
-- | a direct wrapper around JavaScript's `Math.random()`.
foreign import random :: forall e. Eff (random :: RANDOM | e) Number

-- | 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:
-- | ``` purescript<commit_msg>Fix warnings generated by purescript-0.8.0<commit_after>module Control.Monad.Eff.Random where

import Prelude ((<), (<$>), (-), (+), (*), return, bind, ($), one)

import Control.Monad.Eff (Eff())
import Data.Int (toNumber, floor)

-- | The `RANDOM` effect indicates that an Eff action may access or modify the
-- | JavaScript global random number generator, i.e. `Math.random()`.
foreign import data RANDOM :: !

-- | Returns a random number between 0 (inclusive) and 1 (exclusive). This is
-- | a direct wrapper around JavaScript's `Math.random()`.
foreign import random :: forall e. Eff (random :: RANDOM | e) Number

-- | 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:
-- | ``` purescript
{'fraction_non_alphanumeric': 0.14034122179416622, 'fraction_numerical': 0.003852504127682994, 'mean_word_length': 3.734375, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7200566', 'n_tokens_mistral': 553, 'n_tokens_neox': 539, 'n_words': 230}