This file is indexed.

/usr/share/doc/libghc-dependent-map-doc/html/Data-Dependent-Map.html is in libghc-dependent-map-doc 0.2.3.0-3.

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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!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.Dependent.Map</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Data-Dependent-Map.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-Dependent-Map.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">dependent-map-0.2.3.0: Dependent finite maps (partial dependent products)</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>Trustworthy</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Data.Dependent.Map</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Operators</a></li><li><a href="#g:2">Query</a></li><li><a href="#g:3">Construction</a><ul><li><a href="#g:4">Insertion</a></li><li><a href="#g:5">Delete/Update</a></li></ul></li><li><a href="#g:6">Combine</a><ul><li><a href="#g:7">Union</a></li><li><a href="#g:8">Difference</a></li><li><a href="#g:9">Intersection</a></li></ul></li><li><a href="#g:10">Traversal</a><ul><li><a href="#g:11">Map</a></li><li><a href="#g:12">Fold</a></li></ul></li><li><a href="#g:13">Conversion</a><ul><li><a href="#g:14">Lists</a></li><li><a href="#g:15">Ordered lists</a></li></ul></li><li><a href="#g:16">Filter </a></li><li><a href="#g:17">Submap</a></li><li><a href="#g:18">Indexed </a></li><li><a href="#g:19">Min/Max</a></li><li><a href="#g:20">Debugging</a></li><li><a href="#section.orphans">Orphan instances</a></li></ul></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:DMap">DMap</a> k f</li><li class="src short"><span class="keyword">data</span> <a href="#t:DSum">DSum</a> k tag f :: <span class="keyword">forall</span> k. (k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a>) -&gt; (k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a>) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> <span class="keyword">where</span><ul class="subs"><li><a href="#v::-61--62-">(:=&gt;)</a> :: <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f</li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:Some">Some</a> k tag :: <span class="keyword">forall</span> k. (k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a>) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> <span class="keyword">where</span><ul class="subs"><li><a href="#v:This">This</a> :: <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag</li></ul></li><li class="src short"><span class="keyword">class</span> <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-GADT-Compare.html#t:GEq">GEq</a> k f =&gt; <a href="#t:GCompare">GCompare</a> k f <span class="keyword">where</span><ul class="subs"><li><a href="#v:gcompare">gcompare</a> :: f a -&gt; f b -&gt; <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b</li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:GOrdering">GOrdering</a> k a b :: <span class="keyword">forall</span> k. k -&gt; k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> <span class="keyword">where</span><ul class="subs"><li><a href="#v:GLT">GLT</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b</li><li><a href="#v:GEQ">GEQ</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a a</li><li><a href="#v:GGT">GGT</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b</li></ul></li><li class="src short"><a href="#v:-33-">(!)</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; k v -&gt; f v</li><li class="src short"><a href="#v:-92--92-">(\\)</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:null">null</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:size">size</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:member">member</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k a -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:notMember">notMember</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:lookup">lookup</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)</li><li class="src short"><a href="#v:findWithDefault">findWithDefault</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; f v -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; f v</li><li class="src short"><a href="#v:empty">empty</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:singleton">singleton</a> :: k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:insert">insert</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:insertWith">insertWith</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (f v -&gt; f v -&gt; f v) -&gt; k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:insertWith-39-">insertWith'</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (f v -&gt; f v -&gt; f v) -&gt; k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:insertWithKey">insertWithKey</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; f v -&gt; f v) -&gt; k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:insertWithKey-39-">insertWithKey'</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; f v -&gt; f v) -&gt; k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:insertLookupWithKey">insertLookupWithKey</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; f v -&gt; f v) -&gt; k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v), <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f)</li><li class="src short"><a href="#v:insertLookupWithKey-39-">insertLookupWithKey'</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; f v -&gt; f v) -&gt; k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v), <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f)</li><li class="src short"><a href="#v:delete">delete</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:adjust">adjust</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (f v -&gt; f v) -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:adjustWithKey">adjustWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; f v) -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:adjustWithKey-39-">adjustWithKey'</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; f v) -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:update">update</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:updateWithKey">updateWithKey</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:updateLookupWithKey">updateLookupWithKey</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v), <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f)</li><li class="src short"><a href="#v:alter">alter</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:union">union</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:unionWithKey">unionWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; f v -&gt; f v) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:unions">unions</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; [<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f] -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:unionsWithKey">unionsWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; f v -&gt; f v) -&gt; [<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f] -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:difference">difference</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:differenceWithKey">differenceWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; g v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:intersection">intersection</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:intersectionWithKey">intersectionWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; g v -&gt; h v) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k h</li><li class="src short"><a href="#v:map">map</a> :: (<span class="keyword">forall</span> v. f v -&gt; g v) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g</li><li class="src short"><a href="#v:mapWithKey">mapWithKey</a> :: (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; g v) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g</li><li class="src short"><a href="#v:traverseWithKey">traverseWithKey</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> t =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; t (g v)) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; t (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g)</li><li class="src short"><a href="#v:mapAccumLWithKey">mapAccumLWithKey</a> :: (<span class="keyword">forall</span> v. a -&gt; k v -&gt; f v -&gt; (a, g v)) -&gt; a -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (a, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g)</li><li class="src short"><a href="#v:mapAccumRWithKey">mapAccumRWithKey</a> :: (<span class="keyword">forall</span> v. a -&gt; k v -&gt; f v -&gt; (a, g v)) -&gt; a -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (a, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g)</li><li class="src short"><a href="#v:mapKeysWith">mapKeysWith</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k2 =&gt; (<span class="keyword">forall</span> v. k2 v -&gt; f v -&gt; f v -&gt; f v) -&gt; (<span class="keyword">forall</span> v. k1 v -&gt; k2 v) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k2 f</li><li class="src short"><a href="#v:mapKeysMonotonic">mapKeysMonotonic</a> :: (<span class="keyword">forall</span> v. k1 v -&gt; k2 v) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k2 f</li><li class="src short"><a href="#v:foldWithKey">foldWithKey</a> :: (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; b -&gt; b) -&gt; b -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; b</li><li class="src short"><a href="#v:foldrWithKey">foldrWithKey</a> :: (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; b -&gt; b) -&gt; b -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; b</li><li class="src short"><a href="#v:foldlWithKey">foldlWithKey</a> :: (<span class="keyword">forall</span> v. b -&gt; k v -&gt; f v -&gt; b) -&gt; b -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; b</li><li class="src short"><a href="#v:keys">keys</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; [<a href="Data-Dependent-Map.html#t:Some">Some</a> k]</li><li class="src short"><a href="#v:assocs">assocs</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f]</li><li class="src short"><a href="#v:toList">toList</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f]</li><li class="src short"><a href="#v:fromList">fromList</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f] -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:fromListWithKey">fromListWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; f v -&gt; f v) -&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f] -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:toAscList">toAscList</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f]</li><li class="src short"><a href="#v:toDescList">toDescList</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f]</li><li class="src short"><a href="#v:fromAscList">fromAscList</a> :: <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-GADT-Compare.html#t:GEq">GEq</a> k =&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f] -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:fromAscListWithKey">fromAscListWithKey</a> :: <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-GADT-Compare.html#t:GEq">GEq</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; f v -&gt; f v) -&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f] -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:fromDistinctAscList">fromDistinctAscList</a> :: [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f] -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:filter">filter</a> :: (a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; [a] -&gt; [a]</li><li class="src short"><a href="#v:filterWithKey">filterWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:partitionWithKey">partitionWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f)</li><li class="src short"><a href="#v:mapMaybeWithKey">mapMaybeWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (g v)) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g</li><li class="src short"><a href="#v:mapEitherWithKey">mapEitherWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> (g v) (h v)) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k h)</li><li class="src short"><a href="#v:split">split</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f)</li><li class="src short"><a href="#v:splitLookup">splitLookup</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v), <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f)</li><li class="src short"><a href="#v:isSubmapOf">isSubmapOf</a> :: (<a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k, <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#t:EqTag">EqTag</a> k f) =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isSubmapOfBy">isSubmapOfBy</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; k v -&gt; f v -&gt; g v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isProperSubmapOf">isProperSubmapOf</a> :: (<a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k, <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#t:EqTag">EqTag</a> k f) =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isProperSubmapOfBy">isProperSubmapOfBy</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; k v -&gt; f v -&gt; g v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:lookupIndex">lookupIndex</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:findIndex">findIndex</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:elemAt">elemAt</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f</li><li class="src short"><a href="#v:updateAt">updateAt</a> :: (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:deleteAt">deleteAt</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:findMin">findMin</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f</li><li class="src short"><a href="#v:findMax">findMax</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f</li><li class="src short"><a href="#v:lookupMin">lookupMin</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f)</li><li class="src short"><a href="#v:lookupMax">lookupMax</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f)</li><li class="src short"><a href="#v:deleteMin">deleteMin</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:deleteMax">deleteMax</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:deleteFindMin">deleteFindMin</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f)</li><li class="src short"><a href="#v:deleteFindMax">deleteFindMax</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f)</li><li class="src short"><a href="#v:updateMinWithKey">updateMinWithKey</a> :: (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:updateMaxWithKey">updateMaxWithKey</a> :: (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f</li><li class="src short"><a href="#v:minViewWithKey">minViewWithKey</a> :: <span class="keyword">forall</span> k f. <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f)</li><li class="src short"><a href="#v:maxViewWithKey">maxViewWithKey</a> :: <span class="keyword">forall</span> k f. <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f)</li><li class="src short"><a href="#v:showTree">showTree</a> :: <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#t:ShowTag">ShowTag</a> k f =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:showTreeWith">showTreeWith</a> :: (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:valid">valid</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:DMap" class="def">DMap</a> k f <a href="src/Data-Dependent-Map-Internal.html#DMap" class="link">Source</a> <a href="#t:DMap" class="selflink">#</a></p><div class="doc"><p>Dependent maps: <code>k</code> is a GADT-like thing with a facility for 
 rediscovering its type parameter, elements of which function as identifiers
 tagged with the type of the thing they identify.  Real GADTs are one
 useful instantiation of <code>k</code>, as are <code>Tag</code>s from <a href="Data-Unique-Tag.html">Data.Unique.Tag</a> in the 
 'prim-uniq' package.</p><p>Semantically, <code><code><a href="Data-Dependent-Map.html#t:DMap">DMap</a></code> k f</code> is equivalent to a set of <code><code><a href="Data-Dependent-Map.html#t:DSum">DSum</a></code> k f</code> where no two
 elements have the same tag.</p><p>More informally, <code><a href="Data-Dependent-Map.html#t:DMap">DMap</a></code> is to dependent products as <code><a href="M.html#v:Map">Map</a></code> is to <code>(-&gt;)</code>.
 Thus it could also be thought of as a partial (in the sense of &quot;partial
 function&quot;) dependent product.</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:DSum" class="def">DSum</a> k tag f :: <span class="keyword">forall</span> k. (k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a>) -&gt; (k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a>) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> <span class="keyword">where</span> <a href="#t:DSum" class="selflink">#</a></p><div class="doc"><p>A basic dependent sum type; the first component is a tag that specifies 
 the type of the second;  for example, think of a GADT such as:</p><pre>data Tag a where
   AString :: Tag String
   AnInt   :: Tag Int</pre><p>Then, we have the following valid expressions of type <code>DSum Tag</code>:</p><pre>AString :=&gt; &quot;hello!&quot;
AnInt   :=&gt; 42</pre><p>And we can write functions that consume <code>DSum Tag</code> values by matching, 
 such as:</p><pre>toString :: DSum Tag -&gt; String
toString (AString :=&gt; str) = str
toString (AnInt   :=&gt; int) = show int</pre><p>By analogy to the (key =&gt; value) construction for dictionary entries in 
 many dynamic languages, we use (key :=&gt; value) as the constructor for 
 dependent sums.  The :=&gt; operator has very low precedence and binds to 
 the right, so if the <code>Tag</code> GADT is extended with an additional constructor
 <code>Rec :: Tag (DSum Tag)</code>, then <code>Rec :=&gt; AnInt :=&gt; 3 + 4</code> is parsed as
 would be expected (<code>Rec :=&gt; (AnInt :=&gt; (3 + 4))</code>) and has type <code>DSum Tag</code>.
 Its precedence is just above that of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Function.html#v:-36-">$</a></code>, so <code>foo bar $ AString :=&gt; &quot;eep&quot;</code>
 is equivalent to <code>foo bar (AString :=&gt; &quot;eep&quot;)</code>.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v::-61--62-" class="def">(:=&gt;)</a> :: <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f <span class="fixity">infixr 1</span><span class="rightedge"></span></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:DSum" class="caption collapser" onclick="toggleSection('i:DSum')">Instances</p><div id="section.i:DSum" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:DSum:Eq:1" class="instance expander" onclick="toggleSection('i:id:DSum:Eq:1')"></span> <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#t:EqTag">EqTag</a> k tag f =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:DSum:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:DSum:Ord:2" class="instance expander" onclick="toggleSection('i:id:DSum:Ord:2')"></span> <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#t:OrdTag">OrdTag</a> k tag f =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Ord.html#t:Ord">Ord</a> (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:DSum:Ord:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:compare">compare</a> :: <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Ord.html#t:Ordering">Ordering</a> <a href="#v:compare" class="selflink">#</a></p><p class="src"><a href="#v:-60-">(&lt;)</a> :: <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60-" class="selflink">#</a></p><p class="src"><a href="#v:-60--61-">(&lt;=)</a> :: <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62-">(&gt;)</a> :: <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62-" class="selflink">#</a></p><p class="src"><a href="#v:-62--61-">(&gt;=)</a> :: <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62--61-" class="selflink">#</a></p><p class="src"><a href="#v:max">max</a> :: <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f <a href="#v:max" class="selflink">#</a></p><p class="src"><a href="#v:min">min</a> :: <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f <a href="#v:min" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:DSum:Read:3" class="instance expander" onclick="toggleSection('i:id:DSum:Read:3')"></span> <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#t:ReadTag">ReadTag</a> k tag f =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Read.html#t:Read">Read</a> (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:DSum:Read:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:readsPrec">readsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f) <a href="#v:readsPrec" class="selflink">#</a></p><p class="src"><a href="#v:readList">readList</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f] <a href="#v:readList" class="selflink">#</a></p><p class="src"><a href="#v:readPrec">readPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f) <a href="#v:readPrec" class="selflink">#</a></p><p class="src"><a href="#v:readListPrec">readListPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f] <a href="#v:readListPrec" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:DSum:Show:4" class="instance expander" onclick="toggleSection('i:id:DSum:Show:4')"></span> <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#t:ShowTag">ShowTag</a> k tag f =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:DSum:Show:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k tag f] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Some" class="def">Some</a> k tag :: <span class="keyword">forall</span> k. (k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a>) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> <span class="keyword">where</span> <a href="#t:Some" class="selflink">#</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:This" class="def">This</a> :: <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:Some" class="caption collapser" onclick="toggleSection('i:Some')">Instances</p><div id="section.i:Some" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Some:Eq:1" class="instance expander" onclick="toggleSection('i:id:Some:Eq:1')"></span> <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-GADT-Compare.html#t:GEq">GEq</a> k tag =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> (<a href="Data-Dependent-Map.html#t:Some">Some</a> k tag)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Some:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Some:Ord:2" class="instance expander" onclick="toggleSection('i:id:Some:Ord:2')"></span> <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k tag =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Ord.html#t:Ord">Ord</a> (<a href="Data-Dependent-Map.html#t:Some">Some</a> k tag)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Some:Ord:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:compare">compare</a> :: <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Ord.html#t:Ordering">Ordering</a> <a href="#v:compare" class="selflink">#</a></p><p class="src"><a href="#v:-60-">(&lt;)</a> :: <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60-" class="selflink">#</a></p><p class="src"><a href="#v:-60--61-">(&lt;=)</a> :: <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62-">(&gt;)</a> :: <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62-" class="selflink">#</a></p><p class="src"><a href="#v:-62--61-">(&gt;=)</a> :: <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62--61-" class="selflink">#</a></p><p class="src"><a href="#v:max">max</a> :: <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag <a href="#v:max" class="selflink">#</a></p><p class="src"><a href="#v:min">min</a> :: <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag <a href="#v:min" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Some:Read:3" class="instance expander" onclick="toggleSection('i:id:Some:Read:3')"></span> <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-GADT-Show.html#t:GRead">GRead</a> k f =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Read.html#t:Read">Read</a> (<a href="Data-Dependent-Map.html#t:Some">Some</a> k f)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Some:Read:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:readsPrec">readsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> (<a href="Data-Dependent-Map.html#t:Some">Some</a> k f) <a href="#v:readsPrec" class="selflink">#</a></p><p class="src"><a href="#v:readList">readList</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> [<a href="Data-Dependent-Map.html#t:Some">Some</a> k f] <a href="#v:readList" class="selflink">#</a></p><p class="src"><a href="#v:readPrec">readPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> (<a href="Data-Dependent-Map.html#t:Some">Some</a> k f) <a href="#v:readPrec" class="selflink">#</a></p><p class="src"><a href="#v:readListPrec">readListPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> [<a href="Data-Dependent-Map.html#t:Some">Some</a> k f] <a href="#v:readListPrec" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Some:Show:4" class="instance expander" onclick="toggleSection('i:id:Some:Show:4')"></span> <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-GADT-Show.html#t:GShow">GShow</a> k tag =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> (<a href="Data-Dependent-Map.html#t:Some">Some</a> k tag)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:Some:Show:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Data-Dependent-Map.html#t:Some">Some</a> k tag -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Data-Dependent-Map.html#t:Some">Some</a> k tag] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-GADT-Compare.html#t:GEq">GEq</a> k f =&gt; <a id="t:GCompare" class="def">GCompare</a> k f <span class="keyword">where</span> <a href="#t:GCompare" class="selflink">#</a></p><div class="doc"><p>Type class for comparable GADT-like structures.  When 2 things are equal,
 must return a witness that their parameter types are equal as well (<code><a href="Data-Dependent-Map.html#v:GEQ">GEQ</a></code>).</p></div><div class="subs instances"><p id="control.i:GCompare" class="caption collapser" onclick="toggleSection('i:GCompare')">Instances</p><div id="section.i:GCompare" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:GCompare:GCompare:1" class="instance expander" onclick="toggleSection('i:ic:GCompare:GCompare:1')"></span> <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k (<a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-GADT-Compare.html#t::-61-">(:=)</a> k a)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:ic:GCompare:GCompare:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:gcompare">gcompare</a> :: f a -&gt; f b -&gt; <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> (k <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-GADT-Compare.html#t::-61-">:=</a> a) a b <a href="#v:gcompare" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:GOrdering" class="def">GOrdering</a> k a b :: <span class="keyword">forall</span> k. k -&gt; k -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> <span class="keyword">where</span> <a href="#t:GOrdering" class="selflink">#</a></p><div class="doc"><p>A type for the result of comparing GADT constructors; the type parameters
 of the GADT values being compared are included so that in the case where 
 they are equal their parameter types can be unified.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:GLT" class="def">GLT</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:GEQ" class="def">GEQ</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a a</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a id="v:GGT" class="def">GGT</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:GOrdering" class="caption collapser" onclick="toggleSection('i:GOrdering')">Instances</p><div id="section.i:GOrdering" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:GOrdering:GShow:1" class="instance expander" onclick="toggleSection('i:id:GOrdering:GShow:1')"></span> <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-GADT-Show.html#t:GShow">GShow</a> k (<a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:GOrdering:GShow:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:gshowsPrec">gshowsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; t a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:gshowsPrec" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:GOrdering:GRead:2" class="instance expander" onclick="toggleSection('i:id:GOrdering:GRead:2')"></span> <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-GADT-Show.html#t:GRead">GRead</a> k (<a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:GOrdering:GRead:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:greadsPrec">greadsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-GADT-Show.html#t:GReadS">GReadS</a> (<a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a) t <a href="#v:greadsPrec" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:GOrdering:ShowTag:3" class="instance expander" onclick="toggleSection('i:id:GOrdering:ShowTag:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> (f a) =&gt; <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#t:ShowTag">ShowTag</a> k (<a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a) f</span></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:GOrdering:ShowTag:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showTaggedPrec">showTaggedPrec</a> :: f a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; f a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showTaggedPrec" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:GOrdering:Eq:4" class="instance expander" onclick="toggleSection('i:id:GOrdering:Eq:4')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> (<a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:GOrdering:Eq:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:GOrdering:Ord:5" class="instance expander" onclick="toggleSection('i:id:GOrdering:Ord:5')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Ord.html#t:Ord">Ord</a> (<a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:GOrdering:Ord:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:compare">compare</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Ord.html#t:Ordering">Ordering</a> <a href="#v:compare" class="selflink">#</a></p><p class="src"><a href="#v:-60-">(&lt;)</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60-" class="selflink">#</a></p><p class="src"><a href="#v:-60--61-">(&lt;=)</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62-">(&gt;)</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62-" class="selflink">#</a></p><p class="src"><a href="#v:-62--61-">(&gt;=)</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62--61-" class="selflink">#</a></p><p class="src"><a href="#v:max">max</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b <a href="#v:max" class="selflink">#</a></p><p class="src"><a href="#v:min">min</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b <a href="#v:min" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:GOrdering:Show:6" class="instance expander" onclick="toggleSection('i:id:GOrdering:Show:6')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> (<a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b)</span></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:GOrdering:Show:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Data-Dependent-Map.html#t:GOrdering">GOrdering</a> k a b] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><h1 id="g:1">Operators</h1><div class="top"><p class="src"><a id="v:-33-" class="def">(!)</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; k v -&gt; f v <span class="fixity">infixl 9</span><span class="rightedge"></span> <a href="src/Data-Dependent-Map.html#%21" class="link">Source</a> <a href="#v:-33-" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Find the value at a key.
 Calls <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#v:error">error</a></code> when the element can not be found.</p><pre>fromList [(5,'a'), (3,'b')] ! 1    Error: element not in the map
fromList [(5,'a'), (3,'b')] ! 5 == 'a'</pre></div></div><div class="top"><p class="src"><a id="v:-92--92-" class="def">(\\)</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <span class="fixity">infixl 9</span><span class="rightedge"></span> <a href="src/Data-Dependent-Map.html#%5C%5C" class="link">Source</a> <a href="#v:-92--92-" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Data-Dependent-Map.html#v:difference">difference</a></code>.</p></div></div><h1 id="g:2">Query</h1><div class="top"><p class="src"><a id="v:null" class="def">null</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Data-Dependent-Map-Internal.html#null" class="link">Source</a> <a href="#v:null" class="selflink">#</a></p><div class="doc"><p><em>O(1)</em>. Is the map empty?</p></div></div><div class="top"><p class="src"><a id="v:size" class="def">size</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> <a href="src/Data-Dependent-Map-Internal.html#size" class="link">Source</a> <a href="#v:size" class="selflink">#</a></p><div class="doc"><p><em>O(1)</em>. The number of elements in the map.</p></div></div><div class="top"><p class="src"><a id="v:member" class="def">member</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k a -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Data-Dependent-Map.html#member" class="link">Source</a> <a href="#v:member" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Is the key a member of the map? See also <code><a href="Data-Dependent-Map.html#v:notMember">notMember</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:notMember" class="def">notMember</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Data-Dependent-Map.html#notMember" class="link">Source</a> <a href="#v:notMember" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Is the key not a member of the map? See also <code><a href="Data-Dependent-Map.html#v:member">member</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:lookup" class="def">lookup</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v) <a href="src/Data-Dependent-Map-Internal.html#lookup" class="link">Source</a> <a href="#v:lookup" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Lookup the value at a key in the map.</p><p>The function will return the corresponding value as <code>(<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Just">Just</a></code> value)</code>,
 or <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Nothing">Nothing</a></code> if the key isn't in the map.</p></div></div><div class="top"><p class="src"><a id="v:findWithDefault" class="def">findWithDefault</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; f v -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; f v <a href="src/Data-Dependent-Map.html#findWithDefault" class="link">Source</a> <a href="#v:findWithDefault" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. The expression <code>(<code><a href="Data-Dependent-Map.html#v:findWithDefault">findWithDefault</a></code> def k map)</code> returns
 the value at key <code>k</code> or returns default value <code>def</code>
 when the key is not in the map.</p></div></div><h1 id="g:3">Construction</h1><div class="top"><p class="src"><a id="v:empty" class="def">empty</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map-Internal.html#empty" class="link">Source</a> <a href="#v:empty" class="selflink">#</a></p><div class="doc"><p><em>O(1)</em>. The empty map.</p><pre>empty      == fromList []
size empty == 0</pre></div></div><div class="top"><p class="src"><a id="v:singleton" class="def">singleton</a> :: k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map-Internal.html#singleton" class="link">Source</a> <a href="#v:singleton" class="selflink">#</a></p><div class="doc"><p><em>O(1)</em>. A map with a single element.</p><pre>singleton 1 'a'        == fromList [(1, 'a')]
size (singleton 1 'a') == 1</pre></div></div><h2 id="g:4">Insertion</h2><div class="top"><p class="src"><a id="v:insert" class="def">insert</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#insert" class="link">Source</a> <a href="#v:insert" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Insert a new key and value in the map.
 If the key is already present in the map, the associated value is
 replaced with the supplied value. <code><a href="Data-Dependent-Map.html#v:insert">insert</a></code> is equivalent to
 <code><code><a href="Data-Dependent-Map.html#v:insertWith">insertWith</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Function.html#v:const">const</a></code></code>.</p></div></div><div class="top"><p class="src"><a id="v:insertWith" class="def">insertWith</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (f v -&gt; f v -&gt; f v) -&gt; k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#insertWith" class="link">Source</a> <a href="#v:insertWith" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Insert with a function, combining new value and old value.
 <code><code><a href="Data-Dependent-Map.html#v:insertWith">insertWith</a></code> f key value mp</code> 
 will insert the entry <code>key :=&gt; value</code> into <code>mp</code> if key does
 not exist in the map. If the key does exist, the function will
 insert the entry <code>key :=&gt; f new_value old_value</code>.</p></div></div><div class="top"><p class="src"><a id="v:insertWith-39-" class="def">insertWith'</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (f v -&gt; f v -&gt; f v) -&gt; k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#insertWith%27" class="link">Source</a> <a href="#v:insertWith-39-" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Data-Dependent-Map.html#v:insertWith">insertWith</a></code>, but the combining function is applied strictly.
 This is often the most desirable behavior.</p></div></div><div class="top"><p class="src"><a id="v:insertWithKey" class="def">insertWithKey</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; f v -&gt; f v) -&gt; k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#insertWithKey" class="link">Source</a> <a href="#v:insertWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Insert with a function, combining key, new value and old value.
 <code><code><a href="Data-Dependent-Map.html#v:insertWithKey">insertWithKey</a></code> f key value mp</code> 
 will insert the entry <code>key :=&gt; value</code> into <code>mp</code> if key does
 not exist in the map. If the key does exist, the function will
 insert the entry <code>key :=&gt; f key new_value old_value</code>.
 Note that the key passed to f is the same key passed to <code><a href="Data-Dependent-Map.html#v:insertWithKey">insertWithKey</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:insertWithKey-39-" class="def">insertWithKey'</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; f v -&gt; f v) -&gt; k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#insertWithKey%27" class="link">Source</a> <a href="#v:insertWithKey-39-" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Data-Dependent-Map.html#v:insertWithKey">insertWithKey</a></code>, but the combining function is applied strictly.</p></div></div><div class="top"><p class="src"><a id="v:insertLookupWithKey" class="def">insertLookupWithKey</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; f v -&gt; f v) -&gt; k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v), <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f) <a href="src/Data-Dependent-Map.html#insertLookupWithKey" class="link">Source</a> <a href="#v:insertLookupWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Combines insert operation with old value retrieval.
 The expression (<code><code><a href="Data-Dependent-Map.html#v:insertLookupWithKey">insertLookupWithKey</a></code> f k x map</code>)
 is a pair where the first element is equal to (<code><code><a href="Data-Dependent-Map.html#v:lookup">lookup</a></code> k map</code>)
 and the second element equal to (<code><code><a href="Data-Dependent-Map.html#v:insertWithKey">insertWithKey</a></code> f k x map</code>).</p></div></div><div class="top"><p class="src"><a id="v:insertLookupWithKey-39-" class="def">insertLookupWithKey'</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; f v -&gt; f v) -&gt; k v -&gt; f v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v), <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f) <a href="src/Data-Dependent-Map.html#insertLookupWithKey%27" class="link">Source</a> <a href="#v:insertLookupWithKey-39-" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. A strict version of <code><a href="Data-Dependent-Map.html#v:insertLookupWithKey">insertLookupWithKey</a></code>.</p></div></div><h2 id="g:5">Delete/Update</h2><div class="top"><p class="src"><a id="v:delete" class="def">delete</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#delete" class="link">Source</a> <a href="#v:delete" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Delete a key and its value from the map. When the key is not
 a member of the map, the original map is returned.</p></div></div><div class="top"><p class="src"><a id="v:adjust" class="def">adjust</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (f v -&gt; f v) -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#adjust" class="link">Source</a> <a href="#v:adjust" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Update a value at a specific key with the result of the provided function.
 When the key is not
 a member of the map, the original map is returned.</p></div></div><div class="top"><p class="src"><a id="v:adjustWithKey" class="def">adjustWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; f v) -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#adjustWithKey" class="link">Source</a> <a href="#v:adjustWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Adjust a value at a specific key. When the key is not
 a member of the map, the original map is returned.</p></div></div><div class="top"><p class="src"><a id="v:adjustWithKey-39-" class="def">adjustWithKey'</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; f v) -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#adjustWithKey%27" class="link">Source</a> <a href="#v:adjustWithKey-39-" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. A strict version of <code><a href="Data-Dependent-Map.html#v:adjustWithKey">adjustWithKey</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:update" class="def">update</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#update" class="link">Source</a> <a href="#v:update" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. The expression (<code><code><a href="Data-Dependent-Map.html#v:update">update</a></code> f k map</code>) updates the value <code>x</code>
 at <code>k</code> (if it is in the map). If (<code>f x</code>) is <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Nothing">Nothing</a></code>, the element is
 deleted. If it is (<code><code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Just">Just</a></code> y</code>), the key <code>k</code> is bound to the new value <code>y</code>.</p></div></div><div class="top"><p class="src"><a id="v:updateWithKey" class="def">updateWithKey</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#updateWithKey" class="link">Source</a> <a href="#v:updateWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. The expression (<code><code><a href="Data-Dependent-Map.html#v:updateWithKey">updateWithKey</a></code> f k map</code>) updates the
 value <code>x</code> at <code>k</code> (if it is in the map). If (<code>f k x</code>) is <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Nothing">Nothing</a></code>,
 the element is deleted. If it is (<code><code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Just">Just</a></code> y</code>), the key <code>k</code> is bound
 to the new value <code>y</code>.</p></div></div><div class="top"><p class="src"><a id="v:updateLookupWithKey" class="def">updateLookupWithKey</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v), <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f) <a href="src/Data-Dependent-Map.html#updateLookupWithKey" class="link">Source</a> <a href="#v:updateLookupWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Lookup and update. See also <code><a href="Data-Dependent-Map.html#v:updateWithKey">updateWithKey</a></code>.
 The function returns changed value, if it is updated.
 Returns the original key value if the map entry is deleted. </p></div></div><div class="top"><p class="src"><a id="v:alter" class="def">alter</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#alter" class="link">Source</a> <a href="#v:alter" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. The expression (<code><code><a href="Data-Dependent-Map.html#v:alter">alter</a></code> f k map</code>) alters the value <code>x</code> at <code>k</code>, or absence thereof.
 <code><a href="Data-Dependent-Map.html#v:alter">alter</a></code> can be used to insert, delete, or update a value in a <code>Map</code>.
 In short : <code><code><a href="Data-Dependent-Map.html#v:lookup">lookup</a></code> k (<code><a href="Data-Dependent-Map.html#v:alter">alter</a></code> f k m) = f (<code><a href="Data-Dependent-Map.html#v:lookup">lookup</a></code> k m)</code>.</p></div></div><h1 id="g:6">Combine</h1><h2 id="g:7">Union</h2><div class="top"><p class="src"><a id="v:union" class="def">union</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#union" class="link">Source</a> <a href="#v:union" class="selflink">#</a></p><div class="doc"><p><em>O(m*log(n/m + 1)), m &lt;= n</em>.
 The expression (<code><code><a href="Data-Dependent-Map.html#v:union">union</a></code> t1 t2</code>) takes the left-biased union of <code>t1</code> and <code>t2</code>. 
 It prefers <code>t1</code> when duplicate keys are encountered,
 i.e. (<code><code><a href="Data-Dependent-Map.html#v:union">union</a></code> == <code>unionWith</code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Function.html#v:const">const</a></code></code>).</p></div></div><div class="top"><p class="src"><a id="v:unionWithKey" class="def">unionWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; f v -&gt; f v) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#unionWithKey" class="link">Source</a> <a href="#v:unionWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(n+m)</em>.
 Union with a combining function.</p></div></div><div class="top"><p class="src"><a id="v:unions" class="def">unions</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; [<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f] -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#unions" class="link">Source</a> <a href="#v:unions" class="selflink">#</a></p><div class="doc"><p>The union of a list of maps:
   (<code><code><a href="Data-Dependent-Map.html#v:unions">unions</a></code> == <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Foldable.html#v:foldl">foldl</a></code> <code><a href="Data-Dependent-Map.html#v:union">union</a></code> <code><a href="Data-Dependent-Map.html#v:empty">empty</a></code></code>).</p></div></div><div class="top"><p class="src"><a id="v:unionsWithKey" class="def">unionsWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; f v -&gt; f v) -&gt; [<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f] -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#unionsWithKey" class="link">Source</a> <a href="#v:unionsWithKey" class="selflink">#</a></p><div class="doc"><p>The union of a list of maps, with a combining operation:
   (<code><code><a href="Data-Dependent-Map.html#v:unionsWithKey">unionsWithKey</a></code> f == <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Foldable.html#v:foldl">foldl</a></code> (<code><a href="Data-Dependent-Map.html#v:unionWithKey">unionWithKey</a></code> f) <code><a href="Data-Dependent-Map.html#v:empty">empty</a></code></code>).</p></div></div><h2 id="g:8">Difference</h2><div class="top"><p class="src"><a id="v:difference" class="def">difference</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#difference" class="link">Source</a> <a href="#v:difference" class="selflink">#</a></p><div class="doc"><p><em>O(m * log (n/m + 1)), m &lt;= n</em>. Difference of two maps. 
 Return elements of the first map not existing in the second map.</p></div></div><div class="top"><p class="src"><a id="v:differenceWithKey" class="def">differenceWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; g v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#differenceWithKey" class="link">Source</a> <a href="#v:differenceWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(n+m)</em>. Difference with a combining function. When two equal keys are
 encountered, the combining function is applied to the key and both values.
 If it returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Nothing">Nothing</a></code>, the element is discarded (proper set difference). If
 it returns (<code><code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Just">Just</a></code> y</code>), the element is updated with a new value <code>y</code>. </p></div></div><h2 id="g:9">Intersection</h2><div class="top"><p class="src"><a id="v:intersection" class="def">intersection</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#intersection" class="link">Source</a> <a href="#v:intersection" class="selflink">#</a></p><div class="doc"><p><em>O(m * log (n/m + 1), m &lt;= n</em>. Intersection of two maps.
 Return data in the first map for the keys existing in both maps.
 (<code><code><a href="Data-Dependent-Map.html#v:intersection">intersection</a></code> m1 m2 == <code>intersectionWith</code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Function.html#v:const">const</a></code> m1 m2</code>).</p></div></div><div class="top"><p class="src"><a id="v:intersectionWithKey" class="def">intersectionWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; g v -&gt; h v) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k h <a href="src/Data-Dependent-Map.html#intersectionWithKey" class="link">Source</a> <a href="#v:intersectionWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(m * log (n/m + 1), m &lt;= n</em>. Intersection with a combining function.</p></div></div><h1 id="g:10">Traversal</h1><h2 id="g:11">Map</h2><div class="top"><p class="src"><a id="v:map" class="def">map</a> :: (<span class="keyword">forall</span> v. f v -&gt; g v) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g <a href="src/Data-Dependent-Map.html#map" class="link">Source</a> <a href="#v:map" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Map a function over all values in the map.</p></div></div><div class="top"><p class="src"><a id="v:mapWithKey" class="def">mapWithKey</a> :: (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; g v) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g <a href="src/Data-Dependent-Map.html#mapWithKey" class="link">Source</a> <a href="#v:mapWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Map a function over all values in the map.</p></div></div><div class="top"><p class="src"><a id="v:traverseWithKey" class="def">traverseWithKey</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Applicative.html#t:Applicative">Applicative</a> t =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; t (g v)) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; t (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g) <a href="src/Data-Dependent-Map.html#traverseWithKey" class="link">Source</a> <a href="#v:traverseWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>.
 <code><code><a href="Data-Dependent-Map.html#v:traverseWithKey">traverseWithKey</a></code> f m == <code><a href="Data-Dependent-Map.html#v:fromList">fromList</a></code> <a href="$">$</a> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Traversable.html#v:traverse">traverse</a></code> ((k, v) -&gt; (,) k <a href="$">$</a> f k v) (<code><a href="Data-Dependent-Map.html#v:toList">toList</a></code> m)</code>
 That is, behaves exactly like a regular <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Traversable.html#v:traverse">traverse</a></code> except that the traversing
 function also has access to the key associated with a value.</p></div></div><div class="top"><p class="src"><a id="v:mapAccumLWithKey" class="def">mapAccumLWithKey</a> :: (<span class="keyword">forall</span> v. a -&gt; k v -&gt; f v -&gt; (a, g v)) -&gt; a -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (a, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g) <a href="src/Data-Dependent-Map.html#mapAccumLWithKey" class="link">Source</a> <a href="#v:mapAccumLWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. The function <code><a href="Data-Dependent-Map.html#v:mapAccumLWithKey">mapAccumLWithKey</a></code> threads an accumulating
 argument throught the map in ascending order of keys.</p></div></div><div class="top"><p class="src"><a id="v:mapAccumRWithKey" class="def">mapAccumRWithKey</a> :: (<span class="keyword">forall</span> v. a -&gt; k v -&gt; f v -&gt; (a, g v)) -&gt; a -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (a, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g) <a href="src/Data-Dependent-Map.html#mapAccumRWithKey" class="link">Source</a> <a href="#v:mapAccumRWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. The function <code><a href="Data-Dependent-Map.html#v:mapAccumRWithKey">mapAccumRWithKey</a></code> threads an accumulating
 argument through the map in descending order of keys.</p></div></div><div class="top"><p class="src"><a id="v:mapKeysWith" class="def">mapKeysWith</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k2 =&gt; (<span class="keyword">forall</span> v. k2 v -&gt; f v -&gt; f v -&gt; f v) -&gt; (<span class="keyword">forall</span> v. k1 v -&gt; k2 v) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k2 f <a href="src/Data-Dependent-Map.html#mapKeysWith" class="link">Source</a> <a href="#v:mapKeysWith" class="selflink">#</a></p><div class="doc"><p><em>O(n*log n)</em>.
 <code><code><a href="Data-Dependent-Map.html#v:mapKeysWith">mapKeysWith</a></code> c f s</code> is the map obtained by applying <code>f</code> to each key of <code>s</code>.</p><p>The size of the result may be smaller if <code>f</code> maps two or more distinct
 keys to the same new key.  In this case the associated values will be
 combined using <code>c</code>.</p></div></div><div class="top"><p class="src"><a id="v:mapKeysMonotonic" class="def">mapKeysMonotonic</a> :: (<span class="keyword">forall</span> v. k1 v -&gt; k2 v) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k2 f <a href="src/Data-Dependent-Map.html#mapKeysMonotonic" class="link">Source</a> <a href="#v:mapKeysMonotonic" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>.
 <code><code><a href="Data-Dependent-Map.html#v:mapKeysMonotonic">mapKeysMonotonic</a></code> f s == <code>mapKeys</code> f s</code>, but works only when <code>f</code>
 is strictly monotonic.
 That is, for any values <code>x</code> and <code>y</code>, if <code>x</code> &lt; <code>y</code> then <code>f x</code> &lt; <code>f y</code>.
 <em>The precondition is not checked.</em>
 Semi-formally, we have:</p><pre>and [x &lt; y ==&gt; f x &lt; f y | x &lt;- ls, y &lt;- ls] 
                    ==&gt; mapKeysMonotonic f s == mapKeys f s
    where ls = keys s</pre><p>This means that <code>f</code> maps distinct original keys to distinct resulting keys.
 This function has better performance than <code>mapKeys</code>.</p></div></div><h2 id="g:12">Fold</h2><div class="top"><p class="src"><a id="v:foldWithKey" class="def">foldWithKey</a> :: (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; b -&gt; b) -&gt; b -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; b <a href="src/Data-Dependent-Map.html#foldWithKey" class="link">Source</a> <a href="#v:foldWithKey" class="selflink">#</a></p><div class="doc"><div class="warning"><p>Deprecated: Use foldrWithKey instead</p></div><p><em>O(n)</em>. Fold the keys and values in the map, such that
 <code><code><a href="Data-Dependent-Map.html#v:foldWithKey">foldWithKey</a></code> f z == <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Foldable.html#v:foldr">foldr</a></code> (<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Tuple.html#v:uncurry">uncurry</a></code> f) z . <code><a href="Data-Dependent-Map.html#v:toAscList">toAscList</a></code></code>.</p><p>This is identical to <code><a href="Data-Dependent-Map.html#v:foldrWithKey">foldrWithKey</a></code>, and you should use that one instead of
 this one.  This name is kept for backward compatibility.</p></div></div><div class="top"><p class="src"><a id="v:foldrWithKey" class="def">foldrWithKey</a> :: (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; b -&gt; b) -&gt; b -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; b <a href="src/Data-Dependent-Map.html#foldrWithKey" class="link">Source</a> <a href="#v:foldrWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Post-order fold.  The function will be applied from the lowest
 value to the highest.</p></div></div><div class="top"><p class="src"><a id="v:foldlWithKey" class="def">foldlWithKey</a> :: (<span class="keyword">forall</span> v. b -&gt; k v -&gt; f v -&gt; b) -&gt; b -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; b <a href="src/Data-Dependent-Map.html#foldlWithKey" class="link">Source</a> <a href="#v:foldlWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Pre-order fold.  The function will be applied from the highest
 value to the lowest.</p></div></div><h1 id="g:13">Conversion</h1><div class="top"><p class="src"><a id="v:keys" class="def">keys</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; [<a href="Data-Dependent-Map.html#t:Some">Some</a> k] <a href="src/Data-Dependent-Map.html#keys" class="link">Source</a> <a href="#v:keys" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Return all keys of the map in ascending order.</p><pre>keys (fromList [(5,&quot;a&quot;), (3,&quot;b&quot;)]) == [3,5]
keys empty == []</pre></div></div><div class="top"><p class="src"><a id="v:assocs" class="def">assocs</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f] <a href="src/Data-Dependent-Map.html#assocs" class="link">Source</a> <a href="#v:assocs" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Return all key/value pairs in the map in ascending key order.</p></div></div><h2 id="g:14">Lists</h2><div class="top"><p class="src"><a id="v:toList" class="def">toList</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f] <a href="src/Data-Dependent-Map.html#toList" class="link">Source</a> <a href="#v:toList" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Convert to a list of key/value pairs.</p></div></div><div class="top"><p class="src"><a id="v:fromList" class="def">fromList</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f] -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#fromList" class="link">Source</a> <a href="#v:fromList" class="selflink">#</a></p><div class="doc"><p><em>O(n*log n)</em>. Build a map from a list of key/value pairs. See also <code><a href="Data-Dependent-Map.html#v:fromAscList">fromAscList</a></code>.
 If the list contains more than one value for the same key, the last value
 for the key is retained.</p></div></div><div class="top"><p class="src"><a id="v:fromListWithKey" class="def">fromListWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; f v -&gt; f v) -&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f] -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#fromListWithKey" class="link">Source</a> <a href="#v:fromListWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(n*log n)</em>. Build a map from a list of key/value pairs with a combining function. See also <code><a href="Data-Dependent-Map.html#v:fromAscListWithKey">fromAscListWithKey</a></code>.</p></div></div><h2 id="g:15">Ordered lists</h2><div class="top"><p class="src"><a id="v:toAscList" class="def">toAscList</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f] <a href="src/Data-Dependent-Map.html#toAscList" class="link">Source</a> <a href="#v:toAscList" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Convert to an ascending list.</p></div></div><div class="top"><p class="src"><a id="v:toDescList" class="def">toDescList</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f] <a href="src/Data-Dependent-Map.html#toDescList" class="link">Source</a> <a href="#v:toDescList" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Convert to a descending list.</p></div></div><div class="top"><p class="src"><a id="v:fromAscList" class="def">fromAscList</a> :: <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-GADT-Compare.html#t:GEq">GEq</a> k =&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f] -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#fromAscList" class="link">Source</a> <a href="#v:fromAscList" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Build a map from an ascending list in linear time.
 <em>The precondition (input list is ascending) is not checked.</em></p></div></div><div class="top"><p class="src"><a id="v:fromAscListWithKey" class="def">fromAscListWithKey</a> :: <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-GADT-Compare.html#t:GEq">GEq</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; f v -&gt; f v) -&gt; [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f] -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#fromAscListWithKey" class="link">Source</a> <a href="#v:fromAscListWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Build a map from an ascending list in linear time with a
 combining function for equal keys.
 <em>The precondition (input list is ascending) is not checked.</em></p></div></div><div class="top"><p class="src"><a id="v:fromDistinctAscList" class="def">fromDistinctAscList</a> :: [<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f] -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#fromDistinctAscList" class="link">Source</a> <a href="#v:fromDistinctAscList" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Build a map from an ascending list of distinct elements in linear time.
 <em>The precondition is not checked.</em></p></div></div><h1 id="g:16">Filter </h1><div class="top"><p class="src"><a id="v:filter" class="def">filter</a> :: (a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; [a] -&gt; [a] <a href="#v:filter" class="selflink">#</a></p><div class="doc"><p><code><a href="Data-Dependent-Map.html#v:filter">filter</a></code>, applied to a predicate and a list, returns the list of
 those elements that satisfy the predicate; i.e.,</p><pre>filter p xs = [ x | x &lt;- xs, p x]</pre></div></div><div class="top"><p class="src"><a id="v:filterWithKey" class="def">filterWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#filterWithKey" class="link">Source</a> <a href="#v:filterWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Filter all keys/values that satisfy the predicate.</p></div></div><div class="top"><p class="src"><a id="v:partitionWithKey" class="def">partitionWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f) <a href="src/Data-Dependent-Map.html#partitionWithKey" class="link">Source</a> <a href="#v:partitionWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Partition the map according to a predicate. The first
 map contains all elements that satisfy the predicate, the second all
 elements that fail the predicate. See also <code><a href="Data-Dependent-Map.html#v:split">split</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:mapMaybeWithKey" class="def">mapMaybeWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (g v)) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g <a href="src/Data-Dependent-Map.html#mapMaybeWithKey" class="link">Source</a> <a href="#v:mapMaybeWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Map keys/values and collect the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Just">Just</a></code> results.</p></div></div><div class="top"><p class="src"><a id="v:mapEitherWithKey" class="def">mapEitherWithKey</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#t:Either">Either</a> (g v) (h v)) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k h) <a href="src/Data-Dependent-Map.html#mapEitherWithKey" class="link">Source</a> <a href="#v:mapEitherWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Map keys/values and separate the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#v:Left">Left</a></code> and <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Either.html#v:Right">Right</a></code> results.</p></div></div><div class="top"><p class="src"><a id="v:split" class="def">split</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f) <a href="src/Data-Dependent-Map.html#split" class="link">Source</a> <a href="#v:split" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. The expression (<code><code><a href="Data-Dependent-Map.html#v:split">split</a></code> k map</code>) is a pair <code>(map1,map2)</code> where
 the keys in <code>map1</code> are smaller than <code>k</code> and the keys in <code>map2</code> larger than <code>k</code>.
 Any key equal to <code>k</code> is found in neither <code>map1</code> nor <code>map2</code>.</p></div></div><div class="top"><p class="src"><a id="v:splitLookup" class="def">splitLookup</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v), <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f) <a href="src/Data-Dependent-Map.html#splitLookup" class="link">Source</a> <a href="#v:splitLookup" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. The expression (<code><code><a href="Data-Dependent-Map.html#v:splitLookup">splitLookup</a></code> k map</code>) splits a map just
 like <code><a href="Data-Dependent-Map.html#v:split">split</a></code> but also returns <code><code><a href="Data-Dependent-Map.html#v:lookup">lookup</a></code> k map</code>.</p></div></div><h1 id="g:17">Submap</h1><div class="top"><p class="src"><a id="v:isSubmapOf" class="def">isSubmapOf</a> :: (<a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k, <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#t:EqTag">EqTag</a> k f) =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Data-Dependent-Map.html#isSubmapOf" class="link">Source</a> <a href="#v:isSubmapOf" class="selflink">#</a></p><div class="doc"><p><em>O(n+m)</em>.
 This function is defined as (<code><code><a href="Data-Dependent-Map.html#v:isSubmapOf">isSubmapOf</a></code> = <code><a href="Data-Dependent-Map.html#v:isSubmapOfBy">isSubmapOfBy</a></code> <code><a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#v:eqTagged">eqTagged</a></code>)</code>).</p></div></div><div class="top"><p class="src"><a id="v:isSubmapOfBy" class="def">isSubmapOfBy</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; k v -&gt; f v -&gt; g v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Data-Dependent-Map.html#isSubmapOfBy" class="link">Source</a> <a href="#v:isSubmapOfBy" class="selflink">#</a></p><div class="doc"><p><em>O(n+m)</em>.
 The expression (<code><code><a href="Data-Dependent-Map.html#v:isSubmapOfBy">isSubmapOfBy</a></code> f t1 t2</code>) returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:True">True</a></code> if
 all keys in <code>t1</code> are in tree <code>t2</code>, and when <code>f</code> returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:True">True</a></code> when
 applied to their respective keys and values.</p></div></div><div class="top"><p class="src"><a id="v:isProperSubmapOf" class="def">isProperSubmapOf</a> :: (<a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k, <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#t:EqTag">EqTag</a> k f) =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Data-Dependent-Map.html#isProperSubmapOf" class="link">Source</a> <a href="#v:isProperSubmapOf" class="selflink">#</a></p><div class="doc"><p><em>O(n+m)</em>. Is this a proper submap? (ie. a submap but not equal). 
 Defined as (<code><code><a href="Data-Dependent-Map.html#v:isProperSubmapOf">isProperSubmapOf</a></code> = <code><a href="Data-Dependent-Map.html#v:isProperSubmapOfBy">isProperSubmapOfBy</a></code> <code><a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#v:eqTagged">eqTagged</a></code></code>).</p></div></div><div class="top"><p class="src"><a id="v:isProperSubmapOfBy" class="def">isProperSubmapOfBy</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; (<span class="keyword">forall</span> v. k v -&gt; k v -&gt; f v -&gt; g v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k g -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Data-Dependent-Map.html#isProperSubmapOfBy" class="link">Source</a> <a href="#v:isProperSubmapOfBy" class="selflink">#</a></p><div class="doc"><p><em>O(n+m)</em>. Is this a proper submap? (ie. a submap but not equal).
 The expression (<code><code><a href="Data-Dependent-Map.html#v:isProperSubmapOfBy">isProperSubmapOfBy</a></code> f m1 m2</code>) returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:True">True</a></code> when
 <code>m1</code> and <code>m2</code> are not equal,
 all keys in <code>m1</code> are in <code>m2</code>, and when <code>f</code> returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:True">True</a></code> when
 applied to their respective keys and values. </p></div></div><h1 id="g:18">Indexed </h1><div class="top"><p class="src"><a id="v:lookupIndex" class="def">lookupIndex</a> :: <span class="keyword">forall</span> k f v. <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> <a href="src/Data-Dependent-Map.html#lookupIndex" class="link">Source</a> <a href="#v:lookupIndex" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Lookup the <em>index</em> of a key. The index is a number from
 <em>0</em> up to, but not including, the <code><a href="Data-Dependent-Map.html#v:size">size</a></code> of the map.</p></div></div><div class="top"><p class="src"><a id="v:findIndex" class="def">findIndex</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; k v -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> <a href="src/Data-Dependent-Map.html#findIndex" class="link">Source</a> <a href="#v:findIndex" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Return the <em>index</em> of a key. The index is a number from
 <em>0</em> up to, but not including, the <code><a href="Data-Dependent-Map.html#v:size">size</a></code> of the map. Calls <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#v:error">error</a></code> when
 the key is not a <code><a href="Data-Dependent-Map.html#v:member">member</a></code> of the map.</p></div></div><div class="top"><p class="src"><a id="v:elemAt" class="def">elemAt</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f <a href="src/Data-Dependent-Map.html#elemAt" class="link">Source</a> <a href="#v:elemAt" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Retrieve an element by <em>index</em>. Calls <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#v:error">error</a></code> when an
 invalid index is used.</p></div></div><div class="top"><p class="src"><a id="v:updateAt" class="def">updateAt</a> :: (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#updateAt" class="link">Source</a> <a href="#v:updateAt" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Update the element at <em>index</em>. Does nothing when an
 invalid index is used.</p></div></div><div class="top"><p class="src"><a id="v:deleteAt" class="def">deleteAt</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#deleteAt" class="link">Source</a> <a href="#v:deleteAt" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Delete the element at <em>index</em>.
 Defined as (<code><code><a href="Data-Dependent-Map.html#v:deleteAt">deleteAt</a></code> i map = <code><a href="Data-Dependent-Map.html#v:updateAt">updateAt</a></code> (k x -&gt; <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Nothing">Nothing</a></code>) i map</code>).</p></div></div><h1 id="g:19">Min/Max</h1><div class="top"><p class="src"><a id="v:findMin" class="def">findMin</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f <a href="src/Data-Dependent-Map.html#findMin" class="link">Source</a> <a href="#v:findMin" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. The minimal key of the map. Calls <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#v:error">error</a></code> is the map is empty.</p></div></div><div class="top"><p class="src"><a id="v:findMax" class="def">findMax</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f <a href="src/Data-Dependent-Map.html#findMax" class="link">Source</a> <a href="#v:findMax" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. The maximal key of the map. Calls <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Prelude.html#v:error">error</a></code> is the map is empty.</p></div></div><div class="top"><p class="src"><a id="v:lookupMin" class="def">lookupMin</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f) <a href="src/Data-Dependent-Map.html#lookupMin" class="link">Source</a> <a href="#v:lookupMin" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:lookupMax" class="def">lookupMax</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f) <a href="src/Data-Dependent-Map.html#lookupMax" class="link">Source</a> <a href="#v:lookupMax" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:deleteMin" class="def">deleteMin</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#deleteMin" class="link">Source</a> <a href="#v:deleteMin" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Delete the minimal key. Returns an empty map if the map is empty.</p></div></div><div class="top"><p class="src"><a id="v:deleteMax" class="def">deleteMax</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#deleteMax" class="link">Source</a> <a href="#v:deleteMax" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Delete the maximal key. Returns an empty map if the map is empty.</p></div></div><div class="top"><p class="src"><a id="v:deleteFindMin" class="def">deleteFindMin</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f) <a href="src/Data-Dependent-Map-Internal.html#deleteFindMin" class="link">Source</a> <a href="#v:deleteFindMin" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Delete and find the minimal element.</p><pre>deleteFindMin (fromList [(5,&quot;a&quot;), (3,&quot;b&quot;), (10,&quot;c&quot;)]) == ((3,&quot;b&quot;), fromList[(5,&quot;a&quot;), (10,&quot;c&quot;)]) 
deleteFindMin                                            Error: can not return the minimal element of an empty map</pre></div></div><div class="top"><p class="src"><a id="v:deleteFindMax" class="def">deleteFindMax</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f) <a href="src/Data-Dependent-Map-Internal.html#deleteFindMax" class="link">Source</a> <a href="#v:deleteFindMax" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Delete and find the maximal element.</p><pre>deleteFindMax (fromList [(5,&quot;a&quot;), (3,&quot;b&quot;), (10,&quot;c&quot;)]) == ((10,&quot;c&quot;), fromList [(3,&quot;b&quot;), (5,&quot;a&quot;)])
deleteFindMax empty                                      Error: can not return the maximal element of an empty map</pre></div></div><div class="top"><p class="src"><a id="v:updateMinWithKey" class="def">updateMinWithKey</a> :: (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#updateMinWithKey" class="link">Source</a> <a href="#v:updateMinWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Update the value at the minimal key.</p></div></div><div class="top"><p class="src"><a id="v:updateMaxWithKey" class="def">updateMaxWithKey</a> :: (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (f v)) -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f <a href="src/Data-Dependent-Map.html#updateMaxWithKey" class="link">Source</a> <a href="#v:updateMaxWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Update the value at the maximal key.</p></div></div><div class="top"><p class="src"><a id="v:minViewWithKey" class="def">minViewWithKey</a> :: <span class="keyword">forall</span> k f. <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f) <a href="src/Data-Dependent-Map-Internal.html#minViewWithKey" class="link">Source</a> <a href="#v:minViewWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Retrieves the minimal (key :=&gt; value) entry of the map, and
 the map stripped of that element, or <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Nothing">Nothing</a></code> if passed an empty map.</p></div></div><div class="top"><p class="src"><a id="v:maxViewWithKey" class="def">maxViewWithKey</a> :: <span class="keyword">forall</span> k f. <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Data-Dependent-Map.html#t:DSum">DSum</a> k f, <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f) <a href="src/Data-Dependent-Map-Internal.html#maxViewWithKey" class="link">Source</a> <a href="#v:maxViewWithKey" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em>. Retrieves the maximal (key :=&gt; value) entry of the map, and
 the map stripped of that element, or <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#v:Nothing">Nothing</a></code> if passed an empty map.</p></div></div><h1 id="g:20">Debugging</h1><div class="top"><p class="src"><a id="v:showTree" class="def">showTree</a> :: <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#t:ShowTag">ShowTag</a> k f =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="src/Data-Dependent-Map.html#showTree" class="link">Source</a> <a href="#v:showTree" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Show the tree that implements the map. The tree is shown
 in a compressed, hanging format. See <code><a href="Data-Dependent-Map.html#v:showTreeWith">showTreeWith</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:showTreeWith" class="def">showTreeWith</a> :: (<span class="keyword">forall</span> v. k v -&gt; f v -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>) -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="src/Data-Dependent-Map.html#showTreeWith" class="link">Source</a> <a href="#v:showTreeWith" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. The expression (<code><code><a href="Data-Dependent-Map.html#v:showTreeWith">showTreeWith</a></code> showelem hang wide map</code>) shows
 the tree that implements the map. Elements are shown using the <code>showElem</code> function. If <code>hang</code> is
 <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:True">True</a></code>, a <em>hanging</em> tree is shown otherwise a rotated tree is shown. If
 <code>wide</code> is <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:True">True</a></code>, an extra wide version is shown.</p></div></div><div class="top"><p class="src"><a id="v:valid" class="def">valid</a> :: <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k =&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Data-Dependent-Map.html#valid" class="link">Source</a> <a href="#v:valid" class="selflink">#</a></p><div class="doc"><p><em>O(n)</em>. Test if the internal map structure is valid.</p></div></div><h1>Orphan instances</h1><div id="section.orphans" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:o:ic:Eq:Eq:1" class="instance expander" onclick="toggleSection('i:o:ic:Eq:Eq:1')"></span> <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#t:EqTag">EqTag</a> k k1 f =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f)</span> <a href="src/Data-Dependent-Map.html#line-1090" class="link">Source</a> <a href="#v:-36-fEqDMap" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:o:ic:Eq:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:o:ic:Ord:Ord:2" class="instance expander" onclick="toggleSection('i:o:ic:Ord:Ord:2')"></span> <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#t:OrdTag">OrdTag</a> k k1 f =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Ord.html#t:Ord">Ord</a> (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f)</span> <a href="src/Data-Dependent-Map.html#line-1097" class="link">Source</a> <a href="#v:-36-fOrdDMap" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:o:ic:Ord:Ord:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:compare">compare</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Ord.html#t:Ordering">Ordering</a> <a href="#v:compare" class="selflink">#</a></p><p class="src"><a href="#v:-60-">(&lt;)</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60-" class="selflink">#</a></p><p class="src"><a href="#v:-60--61-">(&lt;=)</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-60--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62-">(&gt;)</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62-" class="selflink">#</a></p><p class="src"><a href="#v:-62--61-">(&gt;=)</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-62--61-" class="selflink">#</a></p><p class="src"><a href="#v:max">max</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f <a href="#v:max" class="selflink">#</a></p><p class="src"><a href="#v:min">min</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f <a href="#v:min" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:o:ic:Read:Read:3" class="instance expander" onclick="toggleSection('i:o:ic:Read:Read:3')"></span> (<a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k k1, <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#t:ReadTag">ReadTag</a> k k1 f) =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Read.html#t:Read">Read</a> (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f)</span> <a href="src/Data-Dependent-Map.html#line-1104" class="link">Source</a> <a href="#v:-36-fReadDMap" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:o:ic:Read:Read:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:readsPrec">readsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f) <a href="#v:readsPrec" class="selflink">#</a></p><p class="src"><a href="#v:readList">readList</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> [<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f] <a href="#v:readList" class="selflink">#</a></p><p class="src"><a href="#v:readPrec">readPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f) <a href="#v:readPrec" class="selflink">#</a></p><p class="src"><a href="#v:readListPrec">readListPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> [<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f] <a href="#v:readListPrec" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:o:ic:Show:Show:4" class="instance expander" onclick="toggleSection('i:o:ic:Show:Show:4')"></span> <a href="file:///usr/share/doc/libghc-dependent-sum-doc/html/Data-Dependent-Sum.html#t:ShowTag">ShowTag</a> k k1 f =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f)</span> <a href="src/Data-Dependent-Map.html#line-1115" class="link">Source</a> <a href="#v:-36-fShowDMap" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:o:ic:Show:Show:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:o:ic:Monoid:Monoid:5" class="instance expander" onclick="toggleSection('i:o:ic:Monoid:Monoid:5')"></span> <a href="Data-Dependent-Map.html#t:GCompare">GCompare</a> k k1 =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Monoid.html#t:Monoid">Monoid</a> (<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f)</span> <a href="src/Data-Dependent-Map.html#line-161" class="link">Source</a> <a href="#v:-36-fMonoidDMap" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:o:ic:Monoid:Monoid:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:mempty">mempty</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f <a href="#v:mempty" class="selflink">#</a></p><p class="src"><a href="#v:mappend">mappend</a> :: <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f <a href="#v:mappend" class="selflink">#</a></p><p class="src"><a href="#v:mconcat">mconcat</a> :: [<a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f] -&gt; <a href="Data-Dependent-Map.html#t:DMap">DMap</a> k k1 f <a href="#v:mconcat" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.2</p></div></body></html>