temochka / enclojure / Enclojure.ValueSet

Represents a set of values. Operation complexity depends on the type of the value. For keywords, symbols, strings, floats, and integers, the complexity of insert/remove operations is logarithmic. For other value types, the complexity is typically linear or worse, depending on the type of key values.

Creating


type alias ValueSet io =
Enclojure.Common.ValueSet io

Represents a set of values.

empty : ValueSet io

Returns an empty set.

fromList : List (Enclojure.Common.Value io) -> ValueSet io

Creates a new set from a list of values.

Accessing values

toList : ValueSet io -> List (Enclojure.Common.Value io)

Returns a list of values in the set.

Modifying

insert : Enclojure.Common.Value io -> ValueSet io -> ValueSet io

Inserts a value into the set.

map : (Enclojure.Common.Value io -> Enclojure.Common.Value io) -> ValueSet io -> ValueSet io

Applies a given function to each value in the set.

remove : Enclojure.Common.Value io -> ValueSet io -> ValueSet io

Removes a value from the set or does nothing if it's not present.

Predicates

isEmpty : ValueSet io -> Basics.Bool

Returns True if the set is empty.

member : Enclojure.Common.Value io -> ValueSet io -> Basics.Bool

Returns True if a given value is in the set.