[Home] Type Microsoft.FSharp.Collections.HashSet


Mutable hash sets based by default on F# structural "hash" and (=) functions. Implemented via a hash table and/or Dictionary.

Full Type Signature

type HashSet<'a>
  with
    interface IEnumerable
    interface IEnumerable<'a>
    member Add : 'a -> unit
    member Clear : unit -> unit
    member Contains : 'a -> bool
    member Copy : unit -> HashSet<'a>
    [<OverloadIDAttribute ("Create_seq")>]
    static member Create : seq<'a> -> HashSet<'a>
    [<Obsolete ("HashStats are deprecated. The HashStats argument will be ignored")>]
    static member Create : IEqualityComparer<'a> * HashStats * int -> HashSet<'a>
    static member Create : IEqualityComparer<'a> * int -> HashSet<'a>
    static member Create : int -> HashSet<'a>
    static member Create : unit -> HashSet<'a>
    member Fold : ('a -> 'b -> 'b) -> ('b -> 'b)
    [<Obsolete ("GetLongestChain is deprecated. It will return the empty list")>]
    member GetLongestChain : unit -> 'a list
    member Iterate : ('a -> unit) -> unit
    member Remove : 'a -> unit
    member Count : int
  end

Instance Members

MemberDescription
member Add : 'a -> unit
Add an element to the collection
member Clear : unit -> unit
Clear all elements from the set
member Contains : 'a -> bool
Test if the set contains the given element
member Copy : unit -> HashSet<'a>
Make a shallow copy of the set
member Count : int
The total number of elements in the set
member Fold : ('a -> 'b -> 'b) -> ('b -> 'b)
Apply the given function to the set threading the accumulating parameter through the sequence of function applications
member Iterate : ('a -> unit) -> unit
Apply the given function to each binding in the hash table
member Remove : 'a -> unit
Remove the given element from the set

Static Members

MemberDescription
[<OverloadIDAttribute ("Create_seq")>]
member Create : seq<'a> -> HashSet<'a>
Create a new mutable hash set containing elements drawn from the given sequence
member Create : IEqualityComparer<'a> * int -> HashSet<'a>
Create a new empty mutable hash set with an internal bucket array of the given approximate size and with the given key hash/equality functions
member Create : int -> HashSet<'a>
Create a new empty mutable hash set with an internal bucket array of the given approximate size and with key hash/equality based on the F# structural "hash" and (=) functions This function is always inlined to give compilers the opportunity to optimize the structural hash/equality functions based on any available compile-time knowledge of the key type at the call site.
member Create : unit -> HashSet<'a>
Create a new empty mutable hash set with key hash/equality based on the F# structural "hash" and (=) functions This function is always inlined to give compilers the opportunity to optimize the structural hash/equality functions based on any available compile-time knowledge of the key type at the call site.

Deprecated Members

MemberDescription
[<Obsolete ("HashStats are deprecated. The HashStats argument will be ignored")>]
member Create : IEqualityComparer<'a> * HashStats * int -> HashSet<'a>

Note: HashStats are deprecated. The HashStats argument will be ignored

Create a new empty mutable hash set with an internal bucket array of the given approximate size and with the given key hash/equality functions and the given HashStats collector
[<Obsolete ("GetLongestChain is deprecated. It will return the empty list")>]
member GetLongestChain : unit -> 'a list

Note: GetLongestChain is deprecated. It will return the empty list

Use to debug poorly performing hash tables

See Also

Microsoft.FSharp.Collections


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