[Home] Type Microsoft.FSharp.Collections.HashTable


Hash tables based on F# structural "hash" and (=) functions. This is precisely the same type as that manipulated by the functions in [[Microsoft.FSharp.MLLib.Hashtbl]].

Full Type Signature

type HashTable <'a,'b>
  with
    member TryFind : 'a -> 'b option
    member Replace : 'a * 'b -> unit
    member Remove : 'a -> unit
    member Iterate : ('a -> 'b -> unit) -> unit
    member GetLongestChain : unit -> ('a * 'b) list
    member Fold : ('a -> 'b -> 'c -> 'c) -> 'c -> 'c
    member FindAll : 'a -> 'b list
    member Find : 'a -> 'b
    static member Create : int -> HashTable <'a,'b>
    member Copy : unit -> HashTable <'a,'b>
    member Contains : 'a -> bool
    member Clear : unit -> unit
    member Add : 'a * 'b -> unit
  end

Instance Members

MemberDescription
member Add : 'a * 'b -> unit
Add a binding for the element to the table
member Clear : unit -> unit
Clear all elements from the collection
member Contains : 'a -> bool
Test if the collection contains any bindings for the given element
member Copy : unit -> HashTable <'a,'b>
Make a shallow copy of the collection
member Find : 'a -> 'b
Lookup the given element in the table. Raise Not_found/IndexOutOfRangeException if the element is not found.
member FindAll : 'a -> 'b list
Find all bindings for the given element in the table, if any
member Fold : ('a -> 'b -> 'c -> 'c) -> 'c -> 'c
Apply the given function to each element in the collection threading the accumulating parameter through the sequence of function applications
member GetLongestChain : unit -> ('a * 'b) list
Get the longest chain in the hash table as a list. Use for debugging
member Iterate : ('a -> 'b -> unit) -> unit
Apply the given function to each binding in the hash table
member Remove : 'a -> unit
Remove the latest binding (if any) for the given element from the table
member Replace : 'a * 'b -> unit
Replace the latest binding (if any) for the given element.
member TryFind : 'a -> 'b option
Lookup the given element in the table, returning the result as an Option

Static Members

MemberDescription
member Create : int -> HashTable <'a,'b>
Create a new empty mutable hash table with the given initial size

See Also

Microsoft.FSharp.Collections


Documentation for assembly fslib, version 1.1.10.1, generated using F# version 1.1.10.1