[Home] Type Microsoft.FSharp.Collections.Tagged.Set


Immutable sets where a constraint tag carries information about the key-comparer being used. If 'comparerTag is Tags.StructuralComparer then this type is the same as Set (the tag can be ignored).

Full Type Signature

type Set<'a,'comparerTag when 'comparerTag :> IComparer<'a>>
  with
    interface IComparable
    interface IEnumerable
    interface IEnumerable<'a>
    interface ICollection<'a>
    member Add : 'a -> Set<'a,'comparerTag>
    static member Compare : a:Set<'a,'comparerTag> * b:Set<'a,'comparerTag> -> int
    member Contains : 'a -> bool
    static member Create : 'comparerTag * seq<'a> -> Set<'a,'comparerTag>
    static member Difference : Set<'a,'comparerTag> * Set<'a,'comparerTag> -> Set<'a,'comparerTag>
    static member Empty : 'comparerTag -> Set<'a,'comparerTag>
    static member Equality : Set<'a,'comparerTag> * Set<'a,'comparerTag> -> bool
    override Equals : obj -> bool
    member Exists : ('a -> bool) -> bool
    member Filter : ('a -> bool) -> Set<'a,'comparerTag>
    member Fold : ('a -> 'b -> 'b) -> ('b -> 'b)
    member ForAll : ('a -> bool) -> bool
    static member Intersection : Set<'a,'comparerTag> * Set<'a,'comparerTag> -> Set<'a,'comparerTag>
    member IsSubsetOf : Set<'a,'comparerTag> -> bool
    member IsSupersetOf : Set<'a,'comparerTag> -> bool
    member Iterate : ('a -> unit) -> unit
    member Partition : ('a -> bool) -> Set<'a,'comparerTag> * Set<'a,'comparerTag>
    member Remove : 'a -> Set<'a,'comparerTag>
    static member Singleton : 'comparerTag * 'a -> Set<'a,'comparerTag>
    member ToArray : unit -> 'a array
    member ToList : unit -> 'a list
    static member Union : Set<'a,'comparerTag> * Set<'a,'comparerTag> -> Set<'a,'comparerTag>
    [<Obsolete ("This should always return true")>]
    member CheckBalanceInvariant : bool
    member Choose : 'a
    member Count : int
    member IsEmpty : bool
    member MaximumElement : 'a
    member MinimumElement : 'a
    [<Obsolete ("Consider using the .Count property instead")>]
    member Size : int
    static member ( + ) : Set<'a,'comparerTag> * Set<'a,'comparerTag> -> Set<'a,'comparerTag>
    static member ( - ) : Set<'a,'comparerTag> * Set<'a,'comparerTag> -> Set<'a,'comparerTag>
  end

Instance Members

MemberDescription
member Add : 'a -> Set<'a,'comparerTag>
A useful shortcut for Set.add. Note this operation prodcues a new set and does not mutate the original set. The new set will share many storage nodes with the original. See the Set module for further operations on sets.
member Choose : 'a
The number of elements in the set
member Contains : 'a -> bool
A useful shortcut for Set.mem. See the Set module for further operations on sets.
member Count : int
Return the number of elements in the set
override Equals : obj -> bool
member Exists : ('a -> bool) -> 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".
member Filter : ('a -> bool) -> Set<'a,'comparerTag>
Return a new collection containing only the elements of the collection for which the given predicate returns "true"
member Fold : ('a -> 'b -> 'b) -> ('b -> 'b)
Apply the given accumulating function to all the elements of the set
member ForAll : ('a -> bool) -> 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".
member IsEmpty : bool
A useful shortcut for Set.is_empty. See the Set module for further operations on sets.
member IsSubsetOf : Set<'a,'comparerTag> -> bool
Evaluates to "true" if all elements of the second set are in the first
member IsSupersetOf : Set<'a,'comparerTag> -> bool
Evaluates to "true" if all elements of the first set are in the second
member Iterate : ('a -> unit) -> unit
Apply the given function to each binding in the collection
member MaximumElement : 'a
Returns the highest element in the set according to the ordering being used for the set
member MinimumElement : 'a
Returns the lowest element in the set according to the ordering being used for the set
member Partition : ('a -> bool) -> Set<'a,'comparerTag> * Set<'a,'comparerTag>
Build two new sets, one containing the elements for which the given predicate returns 'true', and the other the remaining elements.
member Remove : 'a -> Set<'a,'comparerTag>
A useful shortcut for Set.remove. Note this operation prodcues a new set and does not mutate the original set. The new set will share many storage nodes with the original. See the Set module for further operations on sets.
member ToArray : unit -> 'a array
The elements of the set as an array.
member ToList : unit -> 'a list
The elements of the set as a list.

Static Members

MemberDescription
member
  ( + ) : Set<'a,'comparerTag> * Set<'a,'comparerTag> -> Set<'a,'comparerTag>
Compute the union of the two sets.
member
  ( - ) : Set<'a,'comparerTag> * Set<'a,'comparerTag> -> Set<'a,'comparerTag>
Return a new set with the elements of the second set removed from the first.
member Compare : a:Set<'a,'comparerTag> * b:Set<'a,'comparerTag> -> int
Compares a and b and returns 1 if a > b, -1 if b < a and 0 if a = b
member Create : 'comparerTag * seq<'a> -> Set<'a,'comparerTag>
The empty set based on the given comparer
member
  Difference : Set<'a,'comparerTag> * Set<'a,'comparerTag> ->
               Set<'a,'comparerTag>
Return a new set with the elements of the second set removed from the first.
member Empty : 'comparerTag -> Set<'a,'comparerTag>
The empty set based on the given comparer
member Equality : Set<'a,'comparerTag> * Set<'a,'comparerTag> -> bool
Compares two sets and returns true if they are equal or false otherwise
member
  Intersection : Set<'a,'comparerTag> * Set<'a,'comparerTag> ->
                 Set<'a,'comparerTag>
Compute the intersection of the two sets.
member Singleton : 'comparerTag * 'a -> Set<'a,'comparerTag>
A singleton set based on the given comparison operator
member
  Union : Set<'a,'comparerTag> * Set<'a,'comparerTag> -> Set<'a,'comparerTag>
Compute the union of the two sets.

Deprecated Members

MemberDescription
[<Obsolete ("This should always return true")>]
member CheckBalanceInvariant : bool

Note: This should always return true

[<Obsolete ("Consider using the .Count property instead")>]
member Size : int

Note: Consider using the .Count property instead

A useful shortcut for Set.size. See the Set module for further operations on sets.

See Also

Microsoft.FSharp.Collections.Tagged


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