/usr/share/doc/libghc-unordered-containers-doc/html/Data-HashMap-Strict.html is in libghc-unordered-containers-doc 0.2.3.0-3build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | <!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>Data.HashMap.Strict</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_Data-HashMap-Strict.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-HashMap-Strict.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">unordered-containers-0.2.3.0: Efficient hashing-based container types</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Maintainer</th><td>johan.tibell@gmail.com</td></tr><tr><th>Safe Haskell</th><td>Trustworthy</td></tr></table><p class="caption">Data.HashMap.Strict</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Construction
</a></li><li><a href="#g:2">Basic interface
</a></li><li><a href="#g:3">Combine
</a><ul><li><a href="#g:4">Union
</a></li></ul></li><li><a href="#g:5">Transformations
</a></li><li><a href="#g:6">Difference and intersection
</a></li><li><a href="#g:7">Folds
</a></li><li><a href="#g:8">Filter
</a></li><li><a href="#g:9">Conversions
</a><ul><li><a href="#g:10">Lists
</a></li></ul></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>A map from <em>hashable</em> keys to values. A map cannot contain
duplicate keys; each key can map to at most one value. A <code><a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a></code>
makes no guarantees as to the order of its elements.
</p><p>This map is strict in both the keys and the values; keys and values
are evaluated to <em>weak head normal form</em> before they are added to
the map. Exception: the provided instances are the same as for the
lazy version of this module.
</p><p>The implementation is based on <em>hash array mapped tries</em>. A
<code><a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a></code> is often faster than other tree-based set types,
especially when key comparison is expensive, as in the case of
strings.
</p><p>Many operations have a average-case complexity of <em>O(log n)</em>. The
implementation uses a large base (i.e. 16) so in practice these
operations are constant time.
</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="#t:HashMap">HashMap</a> k v</li><li class="src short"><a href="#v:empty">empty</a> :: <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</li><li class="src short"><a href="#v:singleton">singleton</a> :: <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k => k -> v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</li><li class="src short"><a href="#v:null">null</a> :: <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:size">size</a> :: <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:member">member</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => k -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:lookup">lookup</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => k -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> v</li><li class="src short"><a href="#v:lookupDefault">lookupDefault</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => v -> k -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> v</li><li class="src short"><a href="#v:-33-">(!)</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> k -> v</li><li class="src short"><a href="#v:insert">insert</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => k -> v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</li><li class="src short"><a href="#v:insertWith">insertWith</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => (v -> v -> v) -> k -> v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</li><li class="src short"><a href="#v:delete">delete</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => k -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</li><li class="src short"><a href="#v:adjust">adjust</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => (v -> v) -> k -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</li><li class="src short"><a href="#v:union">union</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</li><li class="src short"><a href="#v:unionWith">unionWith</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => (v -> v -> v) -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</li><li class="src short"><a href="#v:unions">unions</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => [<a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v] -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</li><li class="src short"><a href="#v:map">map</a> :: (v1 -> v2) -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v1 -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v2</li><li class="src short"><a href="#v:traverseWithKey">traverseWithKey</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Applicative.html#t:Applicative">Applicative</a> f => (k -> v1 -> f v2) -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v1 -> f (<a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v2)</li><li class="src short"><a href="#v:difference">difference</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k w -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</li><li class="src short"><a href="#v:intersection">intersection</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k w -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</li><li class="src short"><a href="#v:intersectionWith">intersectionWith</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => (v1 -> v2 -> v3) -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v1 -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v2 -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v3</li><li class="src short"><a href="#v:foldl-39-">foldl'</a> :: (a -> v -> a) -> a -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> a</li><li class="src short"><a href="#v:foldlWithKey-39-">foldlWithKey'</a> :: (a -> k -> v -> a) -> a -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> a</li><li class="src short"><a href="#v:foldr">foldr</a> :: (v -> a -> a) -> a -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> a</li><li class="src short"><a href="#v:foldrWithKey">foldrWithKey</a> :: (k -> v -> a -> a) -> a -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> a</li><li class="src short"><a href="#v:filter">filter</a> :: (v -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a>) -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</li><li class="src short"><a href="#v:filterWithKey">filterWithKey</a> :: (k -> v -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a>) -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</li><li class="src short"><a href="#v:keys">keys</a> :: <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> [k]</li><li class="src short"><a href="#v:elems">elems</a> :: <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> [v]</li><li class="src short"><a href="#v:toList">toList</a> :: <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> [(k, v)]</li><li class="src short"><a href="#v:fromList">fromList</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => [(k, v)] -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</li><li class="src short"><a href="#v:fromListWith">fromListWith</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => (v -> v -> v) -> [(k, v)] -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:HashMap" class="def">HashMap</a> k v <a href="src/Data-HashMap-Base.html#HashMap" class="link">Source</a></p><div class="doc"><p>A map from keys to values. A map cannot contain duplicate keys;
each key can map to at most one value.
</p></div><div class="subs instances"><p id="control.i:HashMap" class="caption collapser" onclick="toggleSection('i:HashMap')">Instances</p><div id="section.i:HashMap" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Typeable-Internal.html#t:Typeable2">Typeable2</a> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> (<a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Foldable.html#t:Foldable">Foldable</a> (<a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k)</td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Traversable.html#t:Traversable">Traversable</a> (<a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> v) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> (<a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Data.html#t:Data">Data</a> k, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Data.html#t:Data">Data</a> v, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Data.html#t:Data">Data</a> (<a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> k, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> v) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> (<a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Monoid.html#t:Monoid">Monoid</a> (<a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v)</td><td class="doc empty"> </td></tr><tr><td class="src">(<a href="/usr/share/doc/ghc-doc/html/libraries/deepseq-1.3.0.1/Control-DeepSeq.html#t:NFData">NFData</a> k, <a href="/usr/share/doc/ghc-doc/html/libraries/deepseq-1.3.0.1/Control-DeepSeq.html#t:NFData">NFData</a> v) => <a href="/usr/share/doc/ghc-doc/html/libraries/deepseq-1.3.0.1/Control-DeepSeq.html#t:NFData">NFData</a> (<a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v)</td><td class="doc empty"> </td></tr></table></div></div></div><h1 id="g:1">Construction
</h1><div class="top"><p class="src"><a name="v:empty" class="def">empty</a> :: <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v<a href="src/Data-HashMap-Base.html#empty" class="link">Source</a></p><div class="doc"><p><em>O(1)</em> Construct an empty map.
</p></div></div><div class="top"><p class="src"><a name="v:singleton" class="def">singleton</a> :: <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k => k -> v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v<a href="src/Data-HashMap-Strict.html#singleton" class="link">Source</a></p><div class="doc"><p><em>O(1)</em> Construct a map with a single element.
</p></div></div><h1 id="g:2">Basic interface
</h1><div class="top"><p class="src"><a name="v:null" class="def">null</a> :: <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a><a href="src/Data-HashMap-Base.html#null" class="link">Source</a></p><div class="doc"><p><em>O(1)</em> Return <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#v:True">True</a></code> if this map is empty, <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#v:False">False</a></code> otherwise.
</p></div></div><div class="top"><p class="src"><a name="v:size" class="def">size</a> :: <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a><a href="src/Data-HashMap-Base.html#size" class="link">Source</a></p><div class="doc"><p><em>O(n)</em> Return the number of key-value mappings in this map.
</p></div></div><div class="top"><p class="src"><a name="v:member" class="def">member</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => k -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a><a href="src/Data-HashMap-Base.html#member" class="link">Source</a></p><div class="doc"><p><em>O(log n)</em> Return <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#v:True">True</a></code> if the specified key is present in the
map, <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#v:False">False</a></code> otherwise.
</p></div></div><div class="top"><p class="src"><a name="v:lookup" class="def">lookup</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => k -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> v<a href="src/Data-HashMap-Base.html#lookup" class="link">Source</a></p><div class="doc"><p><em>O(log n)</em> Return the value to which the specified key is mapped,
or <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#v:Nothing">Nothing</a></code> if this map contains no mapping for the key.
</p></div></div><div class="top"><p class="src"><a name="v:lookupDefault" class="def">lookupDefault</a><a href="src/Data-HashMap-Strict.html#lookupDefault" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k)</td><td class="doc empty"> </td></tr><tr><td class="src">=> v</td><td class="doc"><p>Default value to return.
</p></td></tr><tr><td class="src">-> k</td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v</td><td class="doc empty"> </td></tr><tr><td class="src">-> v</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p><em>O(log n)</em> Return the value to which the specified key is mapped,
or the default value if this map contains no mapping for the key.
</p></div></div><div class="top"><p class="src"><a name="v:-33-" class="def">(!)</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> k -> v<a href="src/Data-HashMap-Base.html#%21" class="link">Source</a></p><div class="doc"><p><em>O(log n)</em> Return the value to which the specified key is mapped.
Calls <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#v:error">error</a></code> if this map contains no mapping for the key.
</p></div></div><div class="top"><p class="src"><a name="v:insert" class="def">insert</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => k -> v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v<a href="src/Data-HashMap-Strict.html#insert" class="link">Source</a></p><div class="doc"><p><em>O(log n)</em> Associate the specified value with the specified
key in this map. If this map previously contained a mapping for
the key, the old value is replaced.
</p></div></div><div class="top"><p class="src"><a name="v:insertWith" class="def">insertWith</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => (v -> v -> v) -> k -> v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v<a href="src/Data-HashMap-Strict.html#insertWith" class="link">Source</a></p><div class="doc"><p><em>O(log n)</em> Associate the value with the key in this map. If
this map previously contained a mapping for the key, the old value
is replaced by the result of applying the given function to the new
and old value. Example:
</p><pre> insertWith f k v map
where f new old = new + old
</pre></div></div><div class="top"><p class="src"><a name="v:delete" class="def">delete</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => k -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v<a href="src/Data-HashMap-Base.html#delete" class="link">Source</a></p><div class="doc"><p><em>O(log n)</em> Remove the mapping for the specified key from this map
if present.
</p></div></div><div class="top"><p class="src"><a name="v:adjust" class="def">adjust</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => (v -> v) -> k -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v<a href="src/Data-HashMap-Strict.html#adjust" class="link">Source</a></p><div class="doc"><p><em>O(log n)</em> Adjust the value tied to a given key in this map only
if it is present. Otherwise, leave the map alone.
</p></div></div><h1 id="g:3">Combine
</h1><h2 id="g:4">Union
</h2><div class="top"><p class="src"><a name="v:union" class="def">union</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v<a href="src/Data-HashMap-Base.html#union" class="link">Source</a></p><div class="doc"><p><em>O(n+m)</em> The union of two maps. If a key occurs in both maps, the
mapping from the first will be the mapping in the result.
</p></div></div><div class="top"><p class="src"><a name="v:unionWith" class="def">unionWith</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => (v -> v -> v) -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v<a href="src/Data-HashMap-Strict.html#unionWith" class="link">Source</a></p><div class="doc"><p><em>O(n+m)</em> The union of two maps. If a key occurs in both maps,
the provided function (first argument) will be used to compute the result.
</p></div></div><div class="top"><p class="src"><a name="v:unions" class="def">unions</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => [<a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v] -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v<a href="src/Data-HashMap-Base.html#unions" class="link">Source</a></p><div class="doc"><p>Construct a set containing all elements from a list of sets.
</p></div></div><h1 id="g:5">Transformations
</h1><div class="top"><p class="src"><a name="v:map" class="def">map</a> :: (v1 -> v2) -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v1 -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v2<a href="src/Data-HashMap-Strict.html#map" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:traverseWithKey" class="def">traverseWithKey</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Applicative.html#t:Applicative">Applicative</a> f => (k -> v1 -> f v2) -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v1 -> f (<a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v2)<a href="src/Data-HashMap-Base.html#traverseWithKey" class="link">Source</a></p><div class="doc"><p><em>O(n)</em> Transform this map by accumulating an Applicative result
from every value.
</p></div></div><h1 id="g:6">Difference and intersection
</h1><div class="top"><p class="src"><a name="v:difference" class="def">difference</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k w -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v<a href="src/Data-HashMap-Base.html#difference" class="link">Source</a></p><div class="doc"><p><em>O(n*log m)</em> Difference of two maps. Return elements of the first map
not existing in the second.
</p></div></div><div class="top"><p class="src"><a name="v:intersection" class="def">intersection</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k w -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v<a href="src/Data-HashMap-Base.html#intersection" class="link">Source</a></p><div class="doc"><p><em>O(n*log m)</em> Intersection of two maps. Return elements of the first
map for keys existing in the second.
</p></div></div><div class="top"><p class="src"><a name="v:intersectionWith" class="def">intersectionWith</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => (v1 -> v2 -> v3) -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v1 -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v2 -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v3<a href="src/Data-HashMap-Strict.html#intersectionWith" class="link">Source</a></p><div class="doc"><p><em>O(n+m)</em> Intersection of two maps. If a key occurs in both maps
the provided function is used to combine the values from the two
maps.
</p></div></div><h1 id="g:7">Folds
</h1><div class="top"><p class="src"><a name="v:foldl-39-" class="def">foldl'</a> :: (a -> v -> a) -> a -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> a<a href="src/Data-HashMap-Base.html#foldl%27" class="link">Source</a></p><div class="doc"><p><em>O(n)</em> Reduce this map by applying a binary operator to all
elements, using the given starting value (typically the
left-identity of the operator). Each application of the operator
is evaluated before before using the result in the next
application. This function is strict in the starting value.
</p></div></div><div class="top"><p class="src"><a name="v:foldlWithKey-39-" class="def">foldlWithKey'</a> :: (a -> k -> v -> a) -> a -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> a<a href="src/Data-HashMap-Base.html#foldlWithKey%27" class="link">Source</a></p><div class="doc"><p><em>O(n)</em> Reduce this map by applying a binary operator to all
elements, using the given starting value (typically the
left-identity of the operator). Each application of the operator
is evaluated before before using the result in the next
application. This function is strict in the starting value.
</p></div></div><div class="top"><p class="src"><a name="v:foldr" class="def">foldr</a> :: (v -> a -> a) -> a -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> a<a href="src/Data-HashMap-Base.html#foldr" class="link">Source</a></p><div class="doc"><p><em>O(n)</em> Reduce this map by applying a binary operator to all
elements, using the given starting value (typically the
right-identity of the operator).
</p></div></div><div class="top"><p class="src"><a name="v:foldrWithKey" class="def">foldrWithKey</a> :: (k -> v -> a -> a) -> a -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> a<a href="src/Data-HashMap-Base.html#foldrWithKey" class="link">Source</a></p><div class="doc"><p><em>O(n)</em> Reduce this map by applying a binary operator to all
elements, using the given starting value (typically the
right-identity of the operator).
</p></div></div><h1 id="g:8">Filter
</h1><div class="top"><p class="src"><a name="v:filter" class="def">filter</a> :: (v -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a>) -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v<a href="src/Data-HashMap-Base.html#filter" class="link">Source</a></p><div class="doc"><p><em>O(n)</em> Filter this map by retaining only elements which values
satisfy a predicate.
</p></div></div><div class="top"><p class="src"><a name="v:filterWithKey" class="def">filterWithKey</a> :: (k -> v -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a>) -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v<a href="src/Data-HashMap-Base.html#filterWithKey" class="link">Source</a></p><div class="doc"><p><em>O(n)</em> Filter this map by retaining only elements satisfying a
predicate.
</p></div></div><h1 id="g:9">Conversions
</h1><div class="top"><p class="src"><a name="v:keys" class="def">keys</a> :: <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> [k]<a href="src/Data-HashMap-Base.html#keys" class="link">Source</a></p><div class="doc"><p><em>O(n)</em> Return a list of this map's keys. The list is produced
lazily.
</p></div></div><div class="top"><p class="src"><a name="v:elems" class="def">elems</a> :: <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> [v]<a href="src/Data-HashMap-Base.html#elems" class="link">Source</a></p><div class="doc"><p><em>O(n)</em> Return a list of this map's values. The list is produced
lazily.
</p></div></div><h2 id="g:10">Lists
</h2><div class="top"><p class="src"><a name="v:toList" class="def">toList</a> :: <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v -> [(k, v)]<a href="src/Data-HashMap-Base.html#toList" class="link">Source</a></p><div class="doc"><p><em>O(n)</em> Return a list of this map's elements. The list is
produced lazily.
</p></div></div><div class="top"><p class="src"><a name="v:fromList" class="def">fromList</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => [(k, v)] -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v<a href="src/Data-HashMap-Strict.html#fromList" class="link">Source</a></p><div class="doc"><p><em>O(n*log n)</em> Construct a map with the supplied mappings. If the
list contains duplicate mappings, the later mappings take
precedence.
</p></div></div><div class="top"><p class="src"><a name="v:fromListWith" class="def">fromListWith</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> k, <a href="/usr/share/doc/libghc-hashable-doc/html/Data-Hashable.html#t:Hashable">Hashable</a> k) => (v -> v -> v) -> [(k, v)] -> <a href="Data-HashMap-Strict.html#t:HashMap">HashMap</a> k v<a href="src/Data-HashMap-Strict.html#fromListWith" class="link">Source</a></p><div class="doc"><p><em>O(n*log n)</em> Construct a map from a list of elements. Uses
the provided function to merge duplicate entries.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
|