Math.NET Numerics
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

142 lines
9.9 KiB

<HTML><HEAD><TITLE>Microsoft.FSharp.Compatibility.OCaml.Hashtbl</TITLE><link rel="stylesheet" type="text/css"href="../msdn.css"></link></HEAD><BODY>
<br><dl>
<dt></dt><dd>
<h1>[<a href='../namespaces.html'>Home</a>] Module <a href='Microsoft.FSharp.Compatibility.html'>Microsoft.FSharp.Compatibility</a>.<a href='Microsoft.FSharp.Compatibility.OCaml.html'>OCaml</a>.Hashtbl </h1><br>
</dd>
<dt></dt><dd>
<table>
<tr valign='top'><td><summary>
Multi-entry hash tables using the structural "hash" and "equals" functions.
These tables can be used with keys of any type, but you should check that
structural hashing and equality are correct for your key type.
Structural hashing is efficient but not a suitable choice in all circumstances,
e.g. may not hash efficiently on non-reference types and deeply-structured types.
Better efficiency is typically achieved if key types are F#-generated
types.
These hash tables may map items to multiple keys (see find_all).
The implementations are not safe for concurrent reading/writing,
and so users of these tables should take an appropriate lock
before reading/writing if used in a concurrent setting.
</summary>
<dt><h3>Type Definitions</h3></dt><dd>
<table width="100%%">
<tr><th width=30%>Type</th><th>Description</th></tr>
<tr valign="top"><td>type <a href='Microsoft.FSharp.Compatibility.OCaml.Hashtbl.type_Provider-3.html'>Provider</a></td><td><summary>
A collection of operations for creating and using hash tables based on particular type-tracked hash/equality functions.
Generated by the Hashtbl.Make and Hashtbl.MakeTagged functors. This type is for use when you wish to
specify a comparison function once and carry around an object that is a provider of (i.e. a factory for) hashtables
that utilize that comparison function.
The 'Tag' type parameter is used to track information about the comparison function, which helps ensure
that you don't mixup maps created with different comparison functions
</summary></td></tr>
<tr valign="top"><td>type <a href='Microsoft.FSharp.Compatibility.OCaml.Hashtbl.type_Provider-2.html'>Provider</a></td><td> Note: an abbreviation for <tt><a href='Microsoft.FSharp.Compatibility.OCaml.Hashtbl.type_Provider-3.html'>Provider</a>&lt;'Key,'Value,IEqualityComparer&lt;'Key&gt;&gt;</tt></td></tr>
<tr valign="top"><td>type <a href='Microsoft.FSharp.Compatibility.OCaml.Hashtbl.type__t-2.html'>t</a></td><td><summary>
OCaml compatible type name, for use when not opening module, e.g. Hashtbl.t
</summary> Note: an abbreviation for <tt><a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt;</tt></td></tr>
</table>
</dd>
<dt><h3>Values</h3></dt><dd>
<table width="100%%">
<tr><th width=60%>Value</th><th>Description</th></tr>
<tr valign="top"><td><pre>val add : <a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt; -> 'Key -> 'Value -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__unit.html'>unit</a></pre></td><td><summary>
Add key and data to the table.
</summary></td></tr>
<tr valign="top"><td><pre>val clear : <a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt; -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__unit.html'>unit</a></pre></td><td><summary>
Empty the table.
</summary></td></tr>
<tr valign="top"><td><pre>val copy : <a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt; -> <a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt;</pre></td><td><summary>
Create a copy of the table. Remember they are imperative and get mutated.
</summary></td></tr>
<tr valign="top"><td><pre>val create : <a href='../FSharp.Core/Microsoft.FSharp.Core.type__int.html'>int</a> -> <a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt;</pre></td><td><summary>
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.
</summary></td></tr>
<tr valign="top"><td><pre>val find : <a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt; -> 'Key -> 'Value</pre></td><td><summary>
Lookup key's data in the table.
Raises exception is key not in table, if this could happen you should be using tryfind.
</summary></td></tr>
<tr valign="top"><td><pre>val find_all : <a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt; -> 'Key -> 'Value <a href='../FSharp.Core/Microsoft.FSharp.Collections.type__list-1.html'>list</a></pre></td><td><summary>
Return all bindings for the given key
</summary></td></tr>
<tr valign="top"><td><pre>val fold :
('Key -> 'Value -> 'State -> 'State) ->
<a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt; -> 'State -> 'State</pre></td><td><summary>
Fold over all bindings
</summary></td></tr>
<tr valign="top"><td><pre>val hash : 'Value -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__int.html'>int</a></pre></td><td><summary>
Hash on the structure of a value according to the F# structural hashing
conventions. See Pervasives.hash
</summary></td></tr>
<tr valign="top"><td><pre>val hashq : 'Value -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__int.html'>int</a></pre></td><td><summary>
Hash on the identity of an object. See Pervasives.hashq.
</summary></td></tr>
<tr valign="top"><td><pre>val iter : ('Key -> 'Value -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__unit.html'>unit</a>) -> <a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt; -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__unit.html'>unit</a></pre></td><td><summary>
Apply the given function to each binding in the hash table
</summary></td></tr>
<tr valign="top"><td><pre>val Make : ('Key -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__int.html'>int</a>) * ('Key -> 'Key -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__bool.html'>bool</a>) -> <a href='Microsoft.FSharp.Compatibility.OCaml.Hashtbl.type_Provider-2.html'>Provider</a>&lt;'Key,'Value&gt;</pre></td><td><summary>
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&lt;string,int&gt; = Hashtbl.Make(myStringHash,myStringEq)
</summary></td></tr>
<tr valign="top"><td><pre>val MakeTagged :
'Tag -> <a href='Microsoft.FSharp.Compatibility.OCaml.Hashtbl.type_Provider-3.html'>Provider</a>&lt;'Key,'Value,'Tag&gt;
(requires 'Tag :> IEqualityComparer&lt;'Key&gt;)</pre></td><td><summary>
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&lt;string&gt; with
member self.GetHashCode(x) = ...
member self.Equals(x,y) = ...
end
end
let MyStringHashProvider : Hashtbl.Provider&lt;string,int&gt; = Hashtbl.MakeTagged(new MyStringHasher())
</summary></td></tr>
<tr valign="top"><td><pre>val mem : <a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt; -> 'Key -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__bool.html'>bool</a></pre></td><td><summary>
Test for the existence of any bindings for the given key
</summary></td></tr>
<tr valign="top"><td><pre>val of_list : ('Key * 'Value) <a href='../FSharp.Core/Microsoft.FSharp.Collections.type__list-1.html'>list</a> -> <a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt;</pre></td><td><summary>
Create a hash table using the given data
</summary></td></tr>
<tr valign="top"><td><pre>val of_seq : <a href='../FSharp.Core/Microsoft.FSharp.Collections.type__seq-1.html'>seq</a>&lt;'Key * 'Value&gt; -> <a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt;</pre></td><td><summary>
Create hash table using the given data
Inlined to enable generation of efficient hash routines for the key type in the common case.
</summary></td></tr>
<tr valign="top"><td><pre>val remove : <a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt; -> 'Key -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__unit.html'>unit</a></pre></td><td><summary>
Remove the latest binding for the given key
</summary></td></tr>
<tr valign="top"><td><pre>val replace : <a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt; -> 'Key -> 'Value -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__unit.html'>unit</a></pre></td><td><summary>
Replace the latest binding for the given key
</summary></td></tr>
<tr valign="top"><td><pre>val tryfind : <a href='Microsoft.FSharp.Collections.type_HashMultiMap-2.html'>HashMultiMap</a>&lt;'Key,'Value&gt; -> 'Key -> 'Value <a href='../FSharp.Core/Microsoft.FSharp.Core.type__option-1.html'>option</a></pre></td><td><summary>
Lookup the key's data in the table
</summary></td></tr>
</table>
</dd>
</td></tr>
<tr valign='top'><td>
<dt><h3>See Also</h3></dt><dd>
<a href="Microsoft.FSharp.Compatibility.OCaml.html">Microsoft.FSharp.Compatibility.OCaml</a> </dd>
</td></tr>
</table>
</dd>
</dl>
<br /> <br/><p><i>Documentation for assembly FSharp.PowerPack, version 1.9.6.16, generated using <a href='http://research.microsoft.com/fsharp/'>F# Programming Language</a> version 1.9.6.16</i></p>
</BODY></HTML>