[Home] Module Microsoft.FSharp.Collections.Set


Type Definitions

TypeDescription
type t For use when not opening the Set module, e.g. Set.t Note: an abbreviation for Set<'a>

Values

ValueDescription
val add : 'a -> Set<'a> -> Set<'a>
Return a new set with an element added to the set. No exception is raised if the set already contains the given element.
val cardinal : Set<'a> -> int
Return the number of elements in the set. Same as "size"
val choose : Set<'a> -> 'a
Choose an arbitrary element from a set
val compare : Set<'a> -> Set<'a> -> int
Compare two sets. Places sets into a total order.
val diff : Set<'a> -> Set<'a> -> Set<'a>
Return a new set with the elements of the second set removed from the first.
val elements : Set<'a> -> 'a list
The elements of the set as a list.
[<GeneralizableValueAttribute ()>]
val empty<'a> : Set<'a>
The empty set.
val equal : Set<'a> -> Set<'a> -> bool
Test if two sets are equal
val exists : ('a -> bool) -> Set<'a> -> bool
Test if any element of the collection satisfies the given predicate. If the elements are "i0...iN" then computes "p i0 or ... or p iN".
val filter : ('a -> bool) -> Set<'a> -> Set<'a>
Return a new collection containing only the elements of the collection for which the given predicate returns "true"
val fold : ('a -> 'b -> 'b) -> Set<'a> -> 'b -> 'b
Apply the given accumulating function to all the elements of the set
val for_all : ('a -> bool) -> Set<'a> -> bool
Test if all elements of the collection satisfy the given predicate. If the elements are "i0...iN" and "j0...jN" then computes "p i0 && ... && p iN".
val inter : Set<'a> -> Set<'a> -> Set<'a>
Compute the intersection of the two sets.
val is_empty : Set<'a> -> bool
Return "true" if the set is empty
val iter : ('a -> unit) -> Set<'a> -> unit
Apply the given function to each element of the set, in order according to the comparison function
val map : ('a -> 'b) -> Set<'a> -> Set<'b>
Return a new collection containing the results of applying the given function to each element of the input set
val max_elt : Set<'a> -> 'a
Returns the highest element in the set according to the ordering being used for the set
val mem : 'a -> Set<'a> -> bool
Evaluates to "true" if the given element is in the given set
val min_elt : Set<'a> -> 'a
Returns the lowest element in the set according to the ordering being used for the set
val of_array : 'a array -> Set<'a>
Build a set that contains the same elements as the given array
val of_list : 'a list -> Set<'a>
Build a set that contains the same elements as the given list
val of_seq : #seq<'a> -> Set<'a>
Build a new collection from the given enumerable object
val partition : ('a -> bool) -> Set<'a> -> Set<'a> * Set<'a>
Split the set into two sets containing the elements for which the given predicate returns true and false respectively
val remove : 'a -> Set<'a> -> Set<'a>
Return a new set with the given element removed. No exception is raised in the set doesn't contain the given element.
val singleton : 'a -> Set<'a>
The set containing the given one element.
val size : Set<'a> -> int
Return the number of elements in the set
val subset : Set<'a> -> Set<'a> -> bool
Evaluates to "true" if all elements of the first set are in the second
val to_array : Set<'a> -> 'a array
Build an array that contains the elements of the set in order
val to_ICollection : Set<'a> -> ICollection<'a>
Return a view of the collection as a .NET collection. Results in a ReadOnly collection
val to_list : Set<'a> -> 'a list
Build a list that contains the elements of the set in order
val to_seq : Set<'a> -> seq<'a>
Return a view of the collection as an enumerable object
val union : Set<'a> -> Set<'a> -> Set<'a>
Compute the union of the two sets.

Deprecated/Unsafe Type Definitions

TypeDescription
type Set

Note: Consider using Collections.Set<_,_> or just Set<_>

Note: an abbreviation for Set<'a>

Deprecated Values

ValueDescription
[<Obsolete ("Consider using of_IEnumerable instead")>]
val of_ICollection : #ICollection<'a> -> Set<'a>

Note: Consider using of_IEnumerable instead

Build a new collection from any type that supports the .NET ICollection interface Unspecified behaviour if the underlying collection is mutated.
[<Obsolete ("Consider using of_seq instead")>]
val of_IEnumerable : #seq<'a> -> Set<'a>

Note: Consider using of_seq instead

Build a new collection from the given enumerable object
[<Obsolete ("Consider using to_seq instead")>]
val to_IEnumerable : Set<'a> -> seq<'a>

Note: Consider using to_seq instead

Return a view of the collection as an enumerable object

See Also

Microsoft.FSharp.Collections


Documentation for assembly FSharp.Core, version 1.9.4.19, generated using F# version 1.9.4.19