[Home] Module Microsoft.FSharp.Collections.Set


Functional programming operators related to the Set<_> type.

Values

ValueDescription
val add : 'T -> Set<'T> -> Set<'T>
Return a new set with an element added to the set. No exception is raised if the set already contains the given element.
val contains : 'T -> Set<'T> -> bool
Evaluates to "true" if the given element is in the given set
val count : Set<'T> -> int
Return the number of elements in the set. Same as size
[<GeneralizableValueAttribute ()>]
val empty<'T> : Set<'T>
The empty set for the type 'T .
val exists : ('T -> bool) -> Set<'T> -> bool
Test if any element of the collection satisfies the given predicate. If the input function is f and the elements are i0...iN then computes p i0 or ... or p iN.
val filter : ('T -> bool) -> Set<'T> -> Set<'T>
Return a new collection containing only the elements of the collection for which the given predicate returns true
val fold : ('State -> 'T -> 'State) -> 'State -> Set<'T> -> 'State
Apply the given accumulating function to all the elements of the set
val foldBack : ('T -> 'State -> 'State) -> Set<'T> -> 'State -> 'State
Apply the given accumulating function to all the elements of the set
[<OCamlCompatibilityAttribute
  ("This F# library function has been renamed. Use 'forall' instead")>]
val for_all : ('T -> bool) -> Set<'T> -> bool
val forall : ('T -> bool) -> Set<'T> -> bool
Test if all elements of the collection satisfy the given predicate. If the input function is f and the elements are i0...iN and "j0...jN" then computes p i0 && ... && p iN.
val intersect : Set<'T> -> Set<'T> -> Set<'T>
Compute the intersection of the two sets.
val intersectMany : seq<Set<'T>> -> Set<'T>
Compute the intersection of a sequence of sets. The sequence must be non-empty
[<OCamlCompatibilityAttribute
  ("This F# library function has been renamed. Use 'isEmpty' instead")>]
val is_empty : Set<'T> -> bool
val isEmpty : Set<'T> -> bool
Return "true" if the set is empty
val iter : ('T -> unit) -> Set<'T> -> unit
Apply the given function to each element of the set, in order according to the comparison function
val map : ('T -> 'U) -> Set<'T> -> Set<'U>
Return a new collection containing the results of applying the given function to each element of the input set
val of_array : 'T array -> Set<'T>
Build a set that contains the same elements as the given array
val of_list : 'T list -> Set<'T>
Build a set that contains the same elements as the given list
val of_seq : seq<'T> -> Set<'T>
Build a new collection from the given enumerable object
val partition : ('T -> bool) -> Set<'T> -> Set<'T> * Set<'T>
Split the set into two sets containing the elements for which the given predicate returns true and false respectively
val remove : 'T -> Set<'T> -> Set<'T>
Return a new set with the given element removed. No exception is raised in the set doesn't contain the given element.
val singleton : 'T -> Set<'T>
The set containing the given one element.
val to_array : Set<'T> -> 'T array
Build an array that contains the elements of the set in order
val to_list : Set<'T> -> 'T list
Build a list that contains the elements of the set in order
val to_seq : Set<'T> -> seq<'T>
Return a view of the collection as an enumerable object
val union : Set<'T> -> Set<'T> -> Set<'T>
Compute the union of the two sets.
val unionMany : seq<Set<'T>> -> Set<'T>
Compute the union of a sequence of sets.

See Also

Microsoft.FSharp.Collections


Documentation for assembly FSharp.Core, version 1.9.6.16, generated using F# Programming Language version 1.9.6.16