Collections.Set<'T> Class (F#)
Immutable sets based on binary trees, where comparison is the F# structural comparison function, potentially using implementations of the IComparable interface on key values.
Namespace/Module Path: Microsoft.FSharp.Collections
Assembly: FSharp.Core (in FSharp.Core.dll)
[<Sealed>]
type Set<[<EqualityConditionalOnAttribute>] 'T (requires comparison)> =
class
interface IComparable
interface IEnumerable
interface IEnumerable
interface ICollection
new Set : seq<'T> -> Set<'T>
member this.Add : 'T -> Set<'T>
member this.Contains : 'T -> bool
member this.IsProperSubsetOf : Set<'T> -> bool
member this.IsProperSupersetOf : Set<'T> -> bool
member this.IsSubsetOf : Set<'T> -> bool
member this.IsSupersetOf : Set<'T> -> bool
member this.Remove : 'T -> Set<'T>
member this.Count : int
member this.IsEmpty : bool
member this.MaximumElement : 'T
member this.MinimumElement : 'T
static member ( + ) : Set<'T> * Set<'T> -> Set<'T>
static member ( - ) : Set<'T> * Set<'T> -> Set<'T>
end
Remarks
See the Set module for further operations on sets. All members of this class are thread-safe and may be used concurrently from multiple threads.
This type is named [FSharpSet] in compiled assemblies. If you are accessing the type from a language other than F#, or through reflection, use this name.
Constructors
Member |
Description |
---|---|
Create a set containing elements drawn from the given sequence. |
Instance Members
Member |
Description |
---|---|
A useful shortcut for Set.add. Note this operation produces a new set and does not mutate the original set. The new set will share many storage nodes with the original. |
|
A useful shortcut for Set.contains. See the Set module for further operations on sets. |
|
The number of elements in the set |
|
A useful shortcut for Set.isEmpty. |
|
Evaluates to true if all elements of the first set are in the second, and at least one element of the second is not in the first. |
|
Evaluates to true if all elements of the second set are in the first, and at least one element of the first is not in the second. |
|
Evaluates to true if all elements of the first set are in the second. |
|
Evaluates to true if all elements of the second set are in the first. |
|
Returns the highest element in the set according to the ordering being used for the set. |
|
Returns the lowest element in the set according to the ordering being used for the set. |
|
A useful shortcut for Set.remove. Note this operation produces a new set and does not mutate the original set. The new set will share many storage nodes with the original. |
Static Members
Member |
Description |
---|---|
Compute the union of the two sets. |
|
Returns a new set with the elements of the second set removed from the first. |
Platforms
Windows 7, Windows Vista SP2, Windows XP SP3, Windows XP x64 SP2, Windows Server 2008 R2, Windows Server 2008 SP2, Windows Server 2003 SP2
Version Information
F# Runtime
Supported in: 2.0, 4.0
Silverlight
Supported in: 3