<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="Start" href="index.html"> <link rel="previous" href="ExtLib.String.html"> <link rel="next" href="ExtLib.Array.html"> <link rel="Up" href="ExtLib.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of class methods" rel=Appendix href="index_methods.html"> <link title="Index of classes" rel=Appendix href="index_classes.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Index of module types" rel=Appendix href="index_module_types.html"> <link title="Base64" rel="Chapter" href="Base64.html"> <link title="BitSet" rel="Chapter" href="BitSet.html"> <link title="Dllist" rel="Chapter" href="Dllist.html"> <link title="DynArray" rel="Chapter" href="DynArray.html"> <link title="Enum" rel="Chapter" href="Enum.html"> <link title="ExtArray" rel="Chapter" href="ExtArray.html"> <link title="ExtBuffer" rel="Chapter" href="ExtBuffer.html"> <link title="ExtBytes" rel="Chapter" href="ExtBytes.html"> <link title="ExtHashtbl" rel="Chapter" href="ExtHashtbl.html"> <link title="ExtLib" rel="Chapter" href="ExtLib.html"> <link title="ExtList" rel="Chapter" href="ExtList.html"> <link title="ExtString" rel="Chapter" href="ExtString.html"> <link title="Global" rel="Chapter" href="Global.html"> <link title="IO" rel="Chapter" href="IO.html"> <link title="OptParse" rel="Chapter" href="OptParse.html"> <link title="Option" rel="Chapter" href="Option.html"> <link title="PMap" rel="Chapter" href="PMap.html"> <link title="RefList" rel="Chapter" href="RefList.html"> <link title="Std" rel="Chapter" href="Std.html"> <link title="UChar" rel="Chapter" href="UChar.html"> <link title="UTF8" rel="Chapter" href="UTF8.html"> <link title="Unzip" rel="Chapter" href="Unzip.html"><link title="New Functions" rel="Section" href="#6_NewFunctions"> <link title="Older Functions" rel="Section" href="#6_OlderFunctions"> <title>ExtLib.Hashtbl</title> </head> <body> <div class="navbar"><a class="pre" href="ExtLib.String.html" title="ExtLib.String">Previous</a> <a class="up" href="ExtLib.html" title="ExtLib">Up</a> <a class="post" href="ExtLib.Array.html" title="ExtLib.Array">Next</a> </div> <h1>Module <a href="type_ExtLib.Hashtbl.html">ExtLib.Hashtbl</a></h1> <pre><span id="MODULEHashtbl"><span class="keyword">module</span> Hashtbl</span>: <code class="type"><a href="ExtHashtbl.Hashtbl.html">ExtHashtbl.Hashtbl</a></code></pre><hr width="100%"> <pre><span id="TYPEt"><span class="keyword">type</span> <code class="type">('a, 'b)</code> t</span> = <code class="type">('a, 'b) Stdlib.Hashtbl.t</code> </pre> <div class="info "> <div class="info-desc"> <p>The type of a hashtable.</p> </div> </div> <h7 id="6_NewFunctions">New Functions</h7> <pre><span id="VALexists"><span class="keyword">val</span> exists</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> 'a -> bool</code></pre><div class="info "> <div class="info-desc"> <p><code class="code">exists h k</code> returns true is at least one item with key <code class="code">k</code> is found in the hashtable.</p> </div> </div> <pre><span id="VALkeys"><span class="keyword">val</span> keys</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> 'a <a href="Enum.html#TYPEt">Enum.t</a></code></pre><div class="info "> <div class="info-desc"> <p>Return an enumeration of all the keys of a hashtable. If the key is in the Hashtable multiple times, all occurrences will be returned.</p> </div> </div> <pre><span id="VALvalues"><span class="keyword">val</span> values</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> 'b <a href="Enum.html#TYPEt">Enum.t</a></code></pre><div class="info "> <div class="info-desc"> <p>Return an enumeration of all the values of a hashtable.</p> </div> </div> <pre><span id="VALenum"><span class="keyword">val</span> enum</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> ('a * 'b) <a href="Enum.html#TYPEt">Enum.t</a></code></pre><div class="info "> <div class="info-desc"> <p>Return an enumeration of (key,value) pairs of a hashtable.</p> </div> </div> <pre><span id="VALof_enum"><span class="keyword">val</span> of_enum</span> : <code class="type">('a * 'b) <a href="Enum.html#TYPEt">Enum.t</a> -> ('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a></code></pre><div class="info "> <div class="info-desc"> <p>Create a hashtable from a (key,value) enumeration.</p> </div> </div> <pre><span id="VALfind_default"><span class="keyword">val</span> find_default</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> 'a -> 'b -> 'b</code></pre><div class="info "> <div class="info-desc"> <p>Find a binding for the key, and return a default value if not found</p> </div> </div> <pre><span id="VALfind_opt"><span class="keyword">val</span> find_opt</span> : <code class="type">('a, 'b) Stdlib.Hashtbl.t -> 'a -> 'b option</code></pre><div class="info "> <div class="info-desc"> <p>Find a binding for the key, or return <code class="code">None</code> if no value is found</p> </div> </div> <pre><span id="VALfind_option"><span class="keyword">val</span> find_option</span> : <code class="type">('a, 'b) Stdlib.Hashtbl.t -> 'a -> 'b option</code></pre><div class="info "> <div class="info-desc"> <p>compatibility, use <code class="code">find_opt</code></p> </div> </div> <pre><span id="VALremove_all"><span class="keyword">val</span> remove_all</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> 'a -> unit</code></pre><div class="info "> <div class="info-desc"> <p>Remove all bindings for the given key</p> </div> </div> <pre><span id="VALmap"><span class="keyword">val</span> map</span> : <code class="type">('b -> 'c) -> ('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> ('a, 'c) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a></code></pre><div class="info "> <div class="info-desc"> <p><code class="code">map f x</code> creates a new hashtable with the same keys as <code class="code">x</code>, but with the function <code class="code">f</code> applied to all the values</p> </div> </div> <pre><span id="VALlength"><span class="keyword">val</span> length</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> int</code></pre><div class="info "> <div class="info-desc"> <p>Return the number of elements inserted into the Hashtbl (including duplicates)</p> </div> </div> <pre><span id="VALreset"><span class="keyword">val</span> reset</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> unit</code></pre> <pre><span id="VALrandomize"><span class="keyword">val</span> randomize</span> : <code class="type">unit -> unit</code></pre> <pre><span id="TYPEstatistics"><span class="keyword">type</span> <code class="type"></code>statistics</span> = <code class="type">Stdlib.Hashtbl.statistics</code> = {</pre><table class="typetable"> <tr> <td align="left" valign="top" > <code> </code></td> <td align="left" valign="top" > <code><span id="TYPEELTstatistics.num_bindings">num_bindings</span> : <code class="type">int</code>;</code></td> </tr> <tr> <td align="left" valign="top" > <code> </code></td> <td align="left" valign="top" > <code><span id="TYPEELTstatistics.num_buckets">num_buckets</span> : <code class="type">int</code>;</code></td> </tr> <tr> <td align="left" valign="top" > <code> </code></td> <td align="left" valign="top" > <code><span id="TYPEELTstatistics.max_bucket_length">max_bucket_length</span> : <code class="type">int</code>;</code></td> </tr> <tr> <td align="left" valign="top" > <code> </code></td> <td align="left" valign="top" > <code><span id="TYPEELTstatistics.bucket_histogram">bucket_histogram</span> : <code class="type">int array</code>;</code></td> </tr></table> } <pre><span id="VALstats"><span class="keyword">val</span> stats</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> <a href="ExtHashtbl.Hashtbl.html#TYPEstatistics">statistics</a></code></pre> <pre><span id="VALseeded_hash_param"><span class="keyword">val</span> seeded_hash_param</span> : <code class="type">int -> int -> int -> 'a -> int</code></pre> <pre><span id="VALseeded_hash"><span class="keyword">val</span> seeded_hash</span> : <code class="type">int -> 'a -> int</code></pre> <pre><span id="VALis_randomized"><span class="keyword">val</span> is_randomized</span> : <code class="type">unit -> bool</code></pre> <pre><span id="VALfilter_map_inplace"><span class="keyword">val</span> filter_map_inplace</span> : <code class="type">('a -> 'b -> 'b option) -> ('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> unit</code></pre><h7 id="6_OlderFunctions">Older Functions</h7><p>Please refer to the Ocaml Manual for documentation of these functions.</p> <pre><span id="VALcreate"><span class="keyword">val</span> create</span> : <code class="type">?random:bool -> int -> ('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a></code></pre><div class="info "> <ul class="info-attributes"> <li><b>Before 4.00.0 </b> <code class="code">random</code> is ignored</li> </ul> </div> <pre><span id="VALclear"><span class="keyword">val</span> clear</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> unit</code></pre> <pre><span id="VALadd"><span class="keyword">val</span> add</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> 'a -> 'b -> unit</code></pre> <pre><span id="VALcopy"><span class="keyword">val</span> copy</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> ('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a></code></pre> <pre><span id="VALfind"><span class="keyword">val</span> find</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> 'a -> 'b</code></pre> <pre><span id="VALfind_all"><span class="keyword">val</span> find_all</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> 'a -> 'b list</code></pre> <pre><span id="VALmem"><span class="keyword">val</span> mem</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> 'a -> bool</code></pre> <pre><span id="VALremove"><span class="keyword">val</span> remove</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> 'a -> unit</code></pre> <pre><span id="VALreplace"><span class="keyword">val</span> replace</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> 'a -> 'b -> unit</code></pre> <pre><span id="VALiter"><span class="keyword">val</span> iter</span> : <code class="type">('a -> 'b -> unit) -> ('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> unit</code></pre> <pre><span id="VALfold"><span class="keyword">val</span> fold</span> : <code class="type">('a -> 'b -> 'c -> 'c) -> ('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> 'c -> 'c</code></pre> <pre><span id="VALhash"><span class="keyword">val</span> hash</span> : <code class="type">'a -> int</code></pre> <pre><span id="VALhash_param"><span class="keyword">val</span> hash_param</span> : <code class="type">int -> int -> 'a -> int</code></pre> <pre><span id="VALto_seq"><span class="keyword">val</span> to_seq</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> ('a * 'b) Stdlib.Seq.t</code></pre><div class="info "> <div class="info-desc"> <p><code class="code">*_seq</code> functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions</p> </div> </div> <pre><span id="VALto_seq_keys"><span class="keyword">val</span> to_seq_keys</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> 'a Stdlib.Seq.t</code></pre> <pre><span id="VALto_seq_values"><span class="keyword">val</span> to_seq_values</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> 'b Stdlib.Seq.t</code></pre> <pre><span id="VALadd_seq"><span class="keyword">val</span> add_seq</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> ('a * 'b) Stdlib.Seq.t -> unit</code></pre> <pre><span id="VALreplace_seq"><span class="keyword">val</span> replace_seq</span> : <code class="type">('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a> -> ('a * 'b) Stdlib.Seq.t -> unit</code></pre> <pre><span id="VALof_seq"><span class="keyword">val</span> of_seq</span> : <code class="type">('a * 'b) Stdlib.Seq.t -> ('a, 'b) <a href="ExtHashtbl.Hashtbl.html#TYPEt">t</a></code></pre><p>Functor interface forwards directly to stdlib implementation (i.e. no enum functions)</p> <pre><span id="MODULETYPEHashedType"><span class="keyword">module type</span> <a href="ExtHashtbl.Hashtbl.HashedType.html">HashedType</a></span> = <code class="type">Stdlib.Hashtbl.HashedType</code></pre> <pre><span id="MODULETYPES"><span class="keyword">module type</span> <a href="ExtHashtbl.Hashtbl.S.html">S</a></span> = <code class="type">Stdlib.Hashtbl.S</code></pre> <pre><span id="MODULEMake"><span class="keyword">module</span> <a href="ExtHashtbl.Hashtbl.Make.html">Make</a></span>: <code class="type">Stdlib.Hashtbl.Make</code></pre> <pre><span id="MODULETYPESeededHashedType"><span class="keyword">module type</span> <a href="ExtHashtbl.Hashtbl.SeededHashedType.html">SeededHashedType</a></span> = <code class="type">Stdlib.Hashtbl.SeededHashedType</code></pre> <pre><span id="MODULETYPESeededS"><span class="keyword">module type</span> <a href="ExtHashtbl.Hashtbl.SeededS.html">SeededS</a></span> = <code class="type">Stdlib.Hashtbl.SeededS</code></pre> <pre><span id="MODULEMakeSeeded"><span class="keyword">module</span> <a href="ExtHashtbl.Hashtbl.MakeSeeded.html">MakeSeeded</a></span>: <code class="type">Stdlib.Hashtbl.MakeSeeded</code></pre></body></html>