Pages
core
Search
Entities
Set
Functions
Adds the given value to the set.
(Set.empty()
|> Set.add("value")) == Set.fromArray(["value"])
Deletes the given value from the set.
(Set.empty()
|> Set.add("value")
|> Set.delete("value")) == Set.empty()
Returns an empty set.
Converts an Array to a Set.
(Set.empty()
|> Set.add("value")) == Set.fromArray(["value"])
Returns whether or not the given set has the given value.
(Set.empty()
|> Set.add(Maybe.just("value"))
|> Set.has(Maybe.just("value"))) == true
Maps over the items of the set to return a new set.
(Set.fromArray([0])
|> Set.map(Number.toString)) == Set.fromArray(["0"])
Returns the size of a set
Set.size(Set.fromArray([0,1,2])) == 3
Converts the Set to an Array.
(Set.empty()
|> Set.add("value")
|> Set.toArray()) == ["value"]