Value | Description |
val add : HashMultiMap<'key,'a> -> 'key -> 'a -> unit |
Add key and data to the table.
|
val clear : HashMultiMap<'key,'a> -> unit |
Empty the table.
|
val copy : HashMultiMap<'key,'a> -> HashMultiMap<'key,'a> |
Create a copy of the table. Remember they are imperative and get mutated.
|
val create : int -> HashMultiMap<'key,'a> |
Create a hash table with the suggested initial size.
Inlined to enable generation of efficient hash routines for the key type in the common case.
|
val find : HashMultiMap<'key,'a> -> 'key -> 'a |
Lookup key's data in the table.
Raises exception is key not in table, if this could happen you should be using tryfind.
|
val find_all : HashMultiMap<'key,'a> -> 'key -> 'a list |
Return all bindings for the given key
|
val fold : ('key -> 'a -> 'c -> 'c) -> HashMultiMap<'key,'a> -> 'c -> 'c |
Fold over all bindings
|
val hash : 'a -> int |
Hash on the structure of a value according to the F# structural hashing
conventions. See Pervasives.hash
|
val hashq : 'a -> int |
Hash on the identity of an object. See Pervasives.hashq.
|
val iter : ('key -> 'a -> unit) -> HashMultiMap<'key,'a> -> unit |
Apply the given function to each binding in the hash table
|
val Make : ('key -> int) * ('key -> 'key -> bool) -> Provider<'key,'a> |
Build a collection of operations for creating and using
hashtables based on the given hash/equality functions. This returns a record
that contains the functions you use to create and manipulate tables of
this kind. The returned value is much like an ML module. You should call Make once for
each new pair of key/value types. You may need to constrain the result
to be an instantiation of Provider.
let MyStringHashProvider : Provider<string,int> = Hashtbl.Make(myStringHash,myStringEq)
|
val MakeTagged :
'tag -> Provider<'key,'a,'tag> when 'tag :> IEqualityComparer<'key> |
Same as Make, except track the comparison function being used through an additional type parameter.
To use this function accurately you need to define a new named class that implements IEqualityComparer and
pass an instance of that class as the first argument. For example:
type MyHasher =
class
new() = { }
interface IEqualityComparer<string> with
member self.GetHashCode(x) = ...
member self.Equals(x,y) = ...
end
end
let MyStringHashProvider : Hashtbl.Provider<string,int> = Hashtbl.MakeTagged(new MyStringHasher())
|
val mem : HashMultiMap<'key,'a> -> 'key -> bool |
Test for the existence of any bindings for the given key
|
val of_list : ('key * 'a) list -> HashMultiMap<'key,'a> |
Create a hash table using the given data
|
val of_seq : #seq<'key * 'a> -> HashMultiMap<'key,'a> |
Create hash table using the given data
Inlined to enable generation of efficient hash routines for the key type in the common case.
|
val remove : HashMultiMap<'key,'a> -> 'key -> unit |
Remove the latest binding for the given key
|
val replace : HashMultiMap<'key,'a> -> 'key -> 'a -> unit |
Replace the latest binding for the given key
|
val stats :
string -> (out_channel -> 'key -> unit) -> out_channel ->
HashMultiMap<'key,'a> -> unit |
Print statistics on a given hash table to the given output channel
|
val tryfind : HashMultiMap<'key,'a> -> 'key -> 'a option |
Lookup the key's data in the table
|