NoRedInk/elm-random-extra/2.1.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 generate. It is very likely, but not guaranteed, that generated sets will be as big as the smaller of the two limits.

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

A generator that creates values not present in a given set.

Combinators

select : Set comparable -> Generator (Maybe comparable)

Generate values from a set. Analogous to Random.Extra.select but with sets

selectWithDefault : comparable -> Set comparable -> Generator comparable

Generate values from a set or a default value. Analogous to Random.Extra.selectWithDefault but with sets