elm-community/elm-random-extra/1.0.1

NOTE: this package is not compatible with Elm 0.19.1

Random.Set

List of Random Set Generators

Generators

empty : Generator (Set comparable)

Generator that always returns the empty set

singleton : Generator comparable -> Generator (Set comparable)

Generator that creates a singleton set from a generator

set : Int -> Generator comparable -> Generator (Set comparable)

Generate a set of at most the given size from a generator.

The size of a generated set is limited both by the integer provided and the number of unique values the generator can produce. It is very likely, but not guaranteed, that generated sets will be as big as the smaller of these two limits.

notInSet : Set comparable -> Generator comparable -> Generator comparable

Filter a generator of all values not in a given set.

Combinators

select : Set comparable -> Generator (Maybe comparable)

Select a value from a set uniformly at random, or Nothing for an empty set. Analogous to Random.Extra.select but with sets.

selectWithDefault : comparable -> Set comparable -> Generator comparable

Select a value from a set uniformly at random, with a default. Analogous to Random.Extra.selectWithDefault but with sets.