aboutsummaryrefslogtreecommitdiff
path: root/tests/golden-tests/tests/Hash.html.ref
blob: 50eef3431659346c70cf3d991072ac44ca873494 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Hash</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Hash.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><A HREF="">Contents</a></li><li><A HREF="">Index</a></li></ul><p class="caption" class="empty">&nbsp;</p></div><div id="content"><div id="module-header"><p class="caption">Hash</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><A HREF="">The <code>HashTable</code> type
</a><ul><li><A HREF="">Operations on <code>HashTable</code>s
</a></li></ul></li><li><A HREF="">The <code>Hash</code> class
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Implementation of fixed-size hash tables, with a type 
  class for constructing hash values for structured types.
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span>  <A HREF="">HashTable</a> key val</li><li class="src short"><A HREF="">new</a> :: (<A HREF="">Eq</a> key, <A HREF="">Hash</a> key) =&gt; <A HREF="">Int</a> -&gt; <A HREF="">IO</a> (<A HREF="">HashTable</a> key val)</li><li class="src short"><A HREF="">insert</a> :: (<A HREF="">Eq</a> key, <A HREF="">Hash</a> key) =&gt; key -&gt; val -&gt; <A HREF="">IO</a> <A HREF="">()</a></li><li class="src short"><A HREF="">lookup</a> :: <A HREF="">Hash</a> key =&gt; key -&gt; <A HREF="">IO</a> (<A HREF="">Maybe</a> val)</li><li class="src short"><span class="keyword">class</span>  <A HREF="">Hash</a> a  <span class="keyword">where</span><ul class="subs"><li><A HREF="">hash</a> :: a -&gt; <A HREF="">Int</a></li></ul></li></ul></div><div id="interface"><h1 id="1">The <code>HashTable</code> type
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:HashTable" class="def">HashTable</a> key val </p><div class="doc"><p>A hash table with keys of type <code>key</code> and values of type <code>val</code>.
 The type <code>key</code> should be an instance of <code><A HREF="">Eq</a></code>.
</p></div></div><h2 id="2">Operations on <code>HashTable</code>s
</h2><div class="top"><p class="src"><a name="v:new" class="def">new</a> :: (<A HREF="">Eq</a> key, <A HREF="">Hash</a> key) =&gt; <A HREF="">Int</a> -&gt; <A HREF="">IO</a> (<A HREF="">HashTable</a> key val)</p><div class="doc"><p>Builds a new hash table with a given size
</p></div></div><div class="top"><p class="src"><a name="v:insert" class="def">insert</a> :: (<A HREF="">Eq</a> key, <A HREF="">Hash</a> key) =&gt; key -&gt; val -&gt; <A HREF="">IO</a> <A HREF="">()</a></p><div class="doc"><p>Inserts a new element into the hash table
</p></div></div><div class="top"><p class="src"><a name="v:lookup" class="def">lookup</a> :: <A HREF="">Hash</a> key =&gt; key -&gt; <A HREF="">IO</a> (<A HREF="">Maybe</a> val)</p><div class="doc"><p>Looks up a key in the hash table, returns <code><code><A HREF="">Just</a></code> val</code> if the key
 was found, or <code><A HREF="">Nothing</a></code> otherwise.
</p></div></div><h1 id="3">The <code>Hash</code> class
</h1><div class="top"><p class="src"><span class="keyword">class</span>  <a name="t:Hash" class="def">Hash</a> a  <span class="keyword">where</span></p><div class="doc"><p>A class of types which can be hashed.
</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:hash" class="def">hash</a> :: a -&gt; <A HREF="">Int</a></p><div class="doc"><p>hashes the value of type <code>a</code> into an <code><A HREF="">Int</a></code>
</p></div></div><div class="subs instances"><p id="control.i:Hash" class="caption collapser" onclick="toggleSection('i:Hash')">Instances</p><div id="section.i:Hash" class="show"><table><tr><td class="src"><A HREF="">Hash</a> <A HREF="">Float</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><A HREF="">Hash</a> <A HREF="">Int</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">(<A HREF="">Hash</a> a, <A HREF="">Hash</a> b) =&gt; <A HREF="">Hash</a> (a, b)</td><td class="doc empty">&nbsp;</td></tr></table></div></div></div></div></div><div id="footer"><p>Produced by <A HREF="">Haddock</a> version 2.8.0</p></div></body></html>