NoRedInk/elm-random-extra/2.1.1

NOTE: this package is not compatible with Elm 0.19.1

Random.String

List of String Generators

Simple Generators

string : Int -> Generator Char -> Generator String

Generate a random string of a given length with a given character generator

fiveLetterEnglishWord = string 5 english
word : Int -> Generator Char -> Generator String

Generate a random word of a given length with a given character generator (alias for string)

englishWord : Int -> Generator String

Generate a random lowercase word with english characters of a given length. Note: This just generates a random string using the letters in english, so there are no guarantees that the result be an actual english word.

capitalizedEnglishWord : Int -> Generator String

Generate a random capitalized word with english characters of a given length. Note: This just generates a random string using the letters in english, so there are no guarantees that the result be an actual english word.

Random Length String Generators

rangeLengthString : Int -> Int -> Generator Char -> Generator String

Generates a random string of random length given the minimum length and maximum length and a given character generator.

rangeLengthWord : Int -> Int -> Generator Char -> Generator String

Alias for rangeLengthString

rangeLengthEnglishWord : Int -> Int -> Generator String

Generate a random lowercase word with english characters of random length given a minimum length and maximum length.

anyEnglishWord : Generator String

Generate a random lowercase word with english characters of random length between 1 34. Aside: 34 was picked as a maximum as "supercalifragilisticexpialidocious" is considered the longest commonly used word and is 34 character long. Longer words do occur, especially in scientific contexts. In which case, consider using rangeLengthEnglishWord for more granular control.

anyCapitalizedEnglishWord : Generator String

Generate a random capitalized word with english characters of random length between 1 34. Aside: 34 was picked as a maximum as "supercalifragilisticexpialidocious" is considered the longest commonly used word and is 34 character long. Longer words do occur, especially in scientific contexts. In which case, consider using rangeLengthEnglishWord for more granular control.

rangeLengthCapitalizedEnglishWord : Int -> Int -> Generator String

Generate a random capitalized word with english characters of random length given a minimum length and a maximum length.