/usr/share/doc/libghc-edison-api-doc/html/Data-Edison-Assoc.html is in libghc-edison-api-doc 1.3.1-2.
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 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | <!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.Edison.Assoc</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-Edison-Assoc.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-Edison-Assoc.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">EdisonAPI-1.3.1: A library of efficient, purely-functional data structures (API)</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>Copyright (c) 1998 Chris Okasaki</td></tr><tr><th>License</th><td>MIT; see COPYRIGHT file for terms and conditions</td></tr><tr><th>Maintainer</th><td>robdockins AT fastmail DOT fm</td></tr><tr><th>Stability</th><td>stable</td></tr><tr><th>Portability</th><td>GHC, Hugs (MPTC and FD)</td></tr><tr><th>Safe Haskell</th><td>Safe</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Data.Edison.Assoc</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Superclass aliases</a></li><li><a href="#g:2">Non-observable associative collections</a></li><li><a href="#g:3">Observable associative collections</a></li><li><a href="#g:4">Specilizations of submap operations</a></li><li><a href="#g:5">Specializations of sequence operations to lists</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>The <em>associative collection</em> abstraction includes finite maps, finite
relations, and priority queues where the priority is separate from the
element. Associative collections are defined in Edison as a set of eight
classes.</p><p>Note that this
hierarchy mirrors the hierarchy for collections, but with the addition
of <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a></code> as a superclass of every associative collection. See
<a href="Data-Edison-Coll.html">Data.Edison.Coll</a> for a description of the class hierarchy.</p><p>In almost all cases, associative collections make no guarantees about
behavior with respect to the actual keys stored and (in the case of
observable maps) which keys can be retrieved. We adopt the convention
that methods which create associative collections are <em>unambiguous</em>
with respect to the key storage behavior, but that methods which can
observe keys are <em>ambiguous</em> with respect to the actual keys returned.</p><p>In all cases where an operation is ambiguous with respect to the key,
the operation is rendered <em>unambiguous</em> if the <code>Eq</code> instance on keys
corresponds to indistinguisability.</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:map">map</a> :: <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => (a -> b) -> m a -> m b</li><li class="src short"><span class="keyword">class</span> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> k, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> m) => <a href="#t:AssocX">AssocX</a> m k | m -> k <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">class</span> (<a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Ord.html#t:Ord">Ord</a> k) => <a href="#t:OrdAssocX">OrdAssocX</a> m k | m -> k <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">class</span> <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => <a href="#t:FiniteMapX">FiniteMapX</a> m k | m -> k <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">class</span> (<a href="Data-Edison-Assoc.html#t:OrdAssocX">OrdAssocX</a> m k, <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k) => <a href="#t:OrdFiniteMapX">OrdFiniteMapX</a> m k | m -> k</li><li class="src short"><span class="keyword">class</span> <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => <a href="#t:Assoc">Assoc</a> m k | m -> k <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">class</span> (<a href="Data-Edison-Assoc.html#t:Assoc">Assoc</a> m k, <a href="Data-Edison-Assoc.html#t:OrdAssocX">OrdAssocX</a> m k) => <a href="#t:OrdAssoc">OrdAssoc</a> m k | m -> k <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">class</span> (<a href="Data-Edison-Assoc.html#t:Assoc">Assoc</a> m k, <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k) => <a href="#t:FiniteMap">FiniteMap</a> m k | m -> k <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">class</span> (<a href="Data-Edison-Assoc.html#t:OrdAssoc">OrdAssoc</a> m k, <a href="Data-Edison-Assoc.html#t:FiniteMap">FiniteMap</a> m k) => <a href="#t:OrdFiniteMap">OrdFiniteMap</a> m k | m -> k</li><li class="src short"><a href="#v:submap">submap</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k) => m a -> m a -> <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:properSubmap">properSubmap</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k) => m a -> m a -> <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:sameMap">sameMap</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k) => m a -> m a -> <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:fromList">fromList</a> :: <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => [(k, a)] -> m a</li><li class="src short"><a href="#v:insertList">insertList</a> :: <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => [(k, a)] -> m a -> m a</li><li class="src short"><a href="#v:unionList">unionList</a> :: <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => [m a] -> m a</li><li class="src short"><a href="#v:deleteList">deleteList</a> :: <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => [k] -> m a -> m a</li><li class="src short"><a href="#v:lookupList">lookupList</a> :: <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => k -> m a -> [a]</li><li class="src short"><a href="#v:elementsList">elementsList</a> :: <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => m a -> [a]</li><li class="src short"><a href="#v:unsafeFromOrdList">unsafeFromOrdList</a> :: <a href="Data-Edison-Assoc.html#t:OrdAssocX">OrdAssocX</a> m k => [(k, a)] -> m a</li><li class="src short"><a href="#v:fromListWith">fromListWith</a> :: <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k => (a -> a -> a) -> [(k, a)] -> m a</li><li class="src short"><a href="#v:fromListWithKey">fromListWithKey</a> :: <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k => (k -> a -> a -> a) -> [(k, a)] -> m a</li><li class="src short"><a href="#v:insertListWith">insertListWith</a> :: <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k => (a -> a -> a) -> [(k, a)] -> m a -> m a</li><li class="src short"><a href="#v:insertListWithKey">insertListWithKey</a> :: <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k => (k -> a -> a -> a) -> [(k, a)] -> m a -> m a</li><li class="src short"><a href="#v:unionListWith">unionListWith</a> :: <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k => (a -> a -> a) -> [m a] -> m a</li><li class="src short"><a href="#v:toList">toList</a> :: <a href="Data-Edison-Assoc.html#t:Assoc">Assoc</a> m k => m a -> [(k, a)]</li><li class="src short"><a href="#v:keysList">keysList</a> :: <a href="Data-Edison-Assoc.html#t:Assoc">Assoc</a> m k => m a -> [k]</li><li class="src short"><a href="#v:toOrdList">toOrdList</a> :: <a href="Data-Edison-Assoc.html#t:OrdAssoc">OrdAssoc</a> m k => m a -> [(k, a)]</li><li class="src short"><a href="#v:unionListWithKey">unionListWithKey</a> :: <a href="Data-Edison-Assoc.html#t:FiniteMap">FiniteMap</a> m k => (k -> a -> a -> a) -> [m a] -> m a</li></ul></div><div id="interface"><h1 id="g:1">Superclass aliases</h1><div class="top"><p class="src"><a id="v:map" class="def">map</a> :: <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => (a -> b) -> m a -> m b <a href="src/Data-Edison-Assoc.html#map" class="link">Source</a> <a href="#v:map" class="selflink">#</a></p><div class="doc"><p>Apply a function to the elements of every binding in the associative
collection. Identical to <code>fmap</code> from <code>Functor</code>.</p><p>This function is always <em>unambiguous</em>.</p></div></div><h1 id="g:2">Non-observable associative collections</h1><div class="top"><p class="src"><span class="keyword">class</span> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> k, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Functor.html#t:Functor">Functor</a> m) => <a id="t:AssocX" class="def">AssocX</a> m k | m -> k <span class="keyword">where</span> <a href="src/Data-Edison-Assoc.html#AssocX" class="link">Source</a> <a href="#t:AssocX" class="selflink">#</a></p><div class="doc"><p>The root class of the associative collection hierarchy.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Data-Edison-Assoc.html#v:empty">empty</a>, <a href="Data-Edison-Assoc.html#v:singleton">singleton</a>, <a href="Data-Edison-Assoc.html#v:fromSeq">fromSeq</a>, <a href="Data-Edison-Assoc.html#v:insert">insert</a>, <a href="Data-Edison-Assoc.html#v:insertSeq">insertSeq</a>, <a href="Data-Edison-Assoc.html#v:union">union</a>, <a href="Data-Edison-Assoc.html#v:unionSeq">unionSeq</a>, <a href="Data-Edison-Assoc.html#v:delete">delete</a>, <a href="Data-Edison-Assoc.html#v:deleteAll">deleteAll</a>, <a href="Data-Edison-Assoc.html#v:deleteSeq">deleteSeq</a>, <a href="Data-Edison-Assoc.html#v:null">null</a>, <a href="Data-Edison-Assoc.html#v:size">size</a>, <a href="Data-Edison-Assoc.html#v:member">member</a>, <a href="Data-Edison-Assoc.html#v:count">count</a>, <a href="Data-Edison-Assoc.html#v:lookup">lookup</a>, <a href="Data-Edison-Assoc.html#v:lookupM">lookupM</a>, <a href="Data-Edison-Assoc.html#v:lookupAll">lookupAll</a>, <a href="Data-Edison-Assoc.html#v:lookupAndDelete">lookupAndDelete</a>, <a href="Data-Edison-Assoc.html#v:lookupAndDeleteM">lookupAndDeleteM</a>, <a href="Data-Edison-Assoc.html#v:lookupAndDeleteAll">lookupAndDeleteAll</a>, <a href="Data-Edison-Assoc.html#v:lookupWithDefault">lookupWithDefault</a>, <a href="Data-Edison-Assoc.html#v:adjust">adjust</a>, <a href="Data-Edison-Assoc.html#v:adjustAll">adjustAll</a>, <a href="Data-Edison-Assoc.html#v:adjustOrInsert">adjustOrInsert</a>, <a href="Data-Edison-Assoc.html#v:adjustAllOrInsert">adjustAllOrInsert</a>, <a href="Data-Edison-Assoc.html#v:adjustOrDelete">adjustOrDelete</a>, <a href="Data-Edison-Assoc.html#v:adjustOrDeleteAll">adjustOrDeleteAll</a>, <a href="Data-Edison-Assoc.html#v:fold">fold</a>, <a href="Data-Edison-Assoc.html#v:fold-39-">fold'</a>, <a href="Data-Edison-Assoc.html#v:fold1">fold1</a>, <a href="Data-Edison-Assoc.html#v:fold1-39-">fold1'</a>, <a href="Data-Edison-Assoc.html#v:filter">filter</a>, <a href="Data-Edison-Assoc.html#v:partition">partition</a>, <a href="Data-Edison-Assoc.html#v:elements">elements</a>, <a href="Data-Edison-Assoc.html#v:strict">strict</a>, <a href="Data-Edison-Assoc.html#v:strictWith">strictWith</a>, <a href="Data-Edison-Assoc.html#v:structuralInvariant">structuralInvariant</a>, <a href="Data-Edison-Assoc.html#v:instanceName">instanceName</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:empty" class="def">empty</a> :: m a <a href="src/Data-Edison-Assoc.html#empty" class="link">Source</a> <a href="#v:empty" class="selflink">#</a></p><div class="doc"><p>The empty associative collection.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:singleton" class="def">singleton</a> :: k -> a -> m a <a href="src/Data-Edison-Assoc.html#singleton" class="link">Source</a> <a href="#v:singleton" class="selflink">#</a></p><div class="doc"><p>Create an associative collection with a single binding.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:fromSeq" class="def">fromSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => seq (k, a) -> m a <a href="src/Data-Edison-Assoc.html#fromSeq" class="link">Source</a> <a href="#v:fromSeq" class="selflink">#</a></p><div class="doc"><p>Create an associative collection from a list of bindings. Which element
and key are kept in the case of duplicate keys is unspecified.</p><p>This function is <em>ambiguous</em> at finite map types if the sequence
contains more than one equivalent key. Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:insert" class="def">insert</a> :: k -> a -> m a -> m a <a href="src/Data-Edison-Assoc.html#insert" class="link">Source</a> <a href="#v:insert" class="selflink">#</a></p><div class="doc"><p>Add a binding to an associative collection. For finite maps, <code><a href="Data-Edison-Assoc.html#v:insert">insert</a></code>
keeps the new element in the case of duplicate keys.</p><p>This function is <em>unambiguous</em>.</p></div><p class="src"><a id="v:insertSeq" class="def">insertSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => seq (k, a) -> m a -> m a <a href="src/Data-Edison-Assoc.html#insertSeq" class="link">Source</a> <a href="#v:insertSeq" class="selflink">#</a></p><div class="doc"><p>Add a sequence of bindings to a collection. For finite maps, which key
and which element are kept in the case of duplicates is unspecified.
However, if a key appears in the sequence and in the map, (one of) the
elements in the list will be given preference.</p><p>This function is <em>ambiguous</em> at finite map types if the sequence contains
more than one equivalent key. Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:union" class="def">union</a> :: m a -> m a -> m a <a href="src/Data-Edison-Assoc.html#union" class="link">Source</a> <a href="#v:union" class="selflink">#</a></p><div class="doc"><p>Merge two associative collections. For finite maps, which element
to keep in the case of duplicate keys is unspecified.</p><p>This function is <em>ambiguous</em> at finite map types if the map keys are not
disjoint. Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:unionSeq" class="def">unionSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => seq (m a) -> m a <a href="src/Data-Edison-Assoc.html#unionSeq" class="link">Source</a> <a href="#v:unionSeq" class="selflink">#</a></p><div class="doc"><p>Merge a sequence of associative collections. Which element
to keep in the case of duplicate keys is unspecified.</p><p>This function is <em>ambiguous</em> at finite map types if the map keys are not
mutually disjoint. Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:delete" class="def">delete</a> :: k -> m a -> m a <a href="src/Data-Edison-Assoc.html#delete" class="link">Source</a> <a href="#v:delete" class="selflink">#</a></p><div class="doc"><p>Delete one binding with the given key, or leave the associative collection
unchanged if it does not contain the key. For bag-like associative
collections, it is unspecified which binding will be removed.</p><p>This function is <em>ambiguous</em> at finite relation types if the key appears more
than once in the relation. Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:deleteAll" class="def">deleteAll</a> :: k -> m a -> m a <a href="src/Data-Edison-Assoc.html#deleteAll" class="link">Source</a> <a href="#v:deleteAll" class="selflink">#</a></p><div class="doc"><p>Delete all bindings with the given key, or leave the associative collection
unchanged if it does not contain the key.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:deleteSeq" class="def">deleteSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => seq k -> m a -> m a <a href="src/Data-Edison-Assoc.html#deleteSeq" class="link">Source</a> <a href="#v:deleteSeq" class="selflink">#</a></p><div class="doc"><p>Delete a single occurrence of each of the given keys from an associative
collection. For bag-like associative collections containing duplicate keys,
it is unspecified which bindings will be removed.</p><p>This function is <em>ambiguous</em> at finite relation types if any key appears both
in the sequence and in the finite relation AND the number of occurrences in
the sequence is less than the number of occurrences in the finite relation.
Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:null" class="def">null</a> :: m a -> <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-Edison-Assoc.html#null" class="link">Source</a> <a href="#v:null" class="selflink">#</a></p><div class="doc"><p>Test whether the associative collection is empty.</p><p><em>Axioms:</em></p><ul><li><pre>null m = (size m == 0)</pre></li></ul><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:size" class="def">size</a> :: m 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-Edison-Assoc.html#size" class="link">Source</a> <a href="#v:size" class="selflink">#</a></p><div class="doc"><p>Return the number of bindings in the associative collection.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:member" class="def">member</a> :: k -> m a -> <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-Edison-Assoc.html#member" class="link">Source</a> <a href="#v:member" class="selflink">#</a></p><div class="doc"><p>Test whether the given key is bound in the associative collection.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:count" class="def">count</a> :: k -> m 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-Edison-Assoc.html#count" class="link">Source</a> <a href="#v:count" class="selflink">#</a></p><div class="doc"><p>Returns the number of bindings with the given key. For finite maps
this will always return 0 or 1.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:lookup" class="def">lookup</a> :: k -> m a -> a <a href="src/Data-Edison-Assoc.html#lookup" class="link">Source</a> <a href="#v:lookup" class="selflink">#</a></p><div class="doc"><p>Find the element associated with the given key. Signals an error if
the given key is not bound. If more than one element is bound by the
given key, it is unspecified which is returned.</p><p>This function is <em>ambiguous</em> at finite relation types if the key appears
more than once in the finite relation. Otherwise, it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:lookupM" class="def">lookupM</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> rm => k -> m a -> rm a <a href="src/Data-Edison-Assoc.html#lookupM" class="link">Source</a> <a href="#v:lookupM" class="selflink">#</a></p><div class="doc"><p>Find the element associated with the given key. Calls <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#v:fail">fail</a></code> if the
given key is not bound. If more than one element is bound by the given
key, it is unspecified which is returned.</p><p>This function is <em>ambiguous</em> at finite relation types if the key appears
more than once in the finite relation. Otherwise, it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:lookupAll" class="def">lookupAll</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => k -> m a -> seq a <a href="src/Data-Edison-Assoc.html#lookupAll" class="link">Source</a> <a href="#v:lookupAll" class="selflink">#</a></p><div class="doc"><p>Return all elements bound by the given key in an unspecified order.</p><p>This function is <em>ambiguous</em> at finite relation types if the key appears
more than once in the finite relation. Otherwise, it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:lookupAndDelete" class="def">lookupAndDelete</a> :: k -> m a -> (a, m a) <a href="src/Data-Edison-Assoc.html#lookupAndDelete" class="link">Source</a> <a href="#v:lookupAndDelete" class="selflink">#</a></p><div class="doc"><p>Find the element associated with the given key; return the element
and the collection with that element deleted. Signals an error if
the given key is not bound. If more than one element is bound by the
given key, it is unspecified which is deleted and returned.</p><p>This function is <em>ambiguous</em> at finite relation types if the key appears
more than once in the finite relation. Otherwise, it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:lookupAndDeleteM" class="def">lookupAndDeleteM</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> rm => k -> m a -> rm (a, m a) <a href="src/Data-Edison-Assoc.html#lookupAndDeleteM" class="link">Source</a> <a href="#v:lookupAndDeleteM" class="selflink">#</a></p><div class="doc"><p>Find the element associated with the given key; return the element
and the collection with that element deleted. Calls <code>fail</code> if
the given key is not bound. If more than one element is bound by the
given key, it is unspecified which is deleted and returned.</p><p>This function is <em>ambiguous</em> at finite relation types if the key appears
more than once in the finite relation. Otherwise, it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:lookupAndDeleteAll" class="def">lookupAndDeleteAll</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => k -> m a -> (seq a, m a) <a href="src/Data-Edison-Assoc.html#lookupAndDeleteAll" class="link">Source</a> <a href="#v:lookupAndDeleteAll" class="selflink">#</a></p><div class="doc"><p>Find all elements bound by the given key; return a sequence containing
all such bound elements in an unspecified order and the collection
with all such elements deleted.</p><p>This function is <em>ambiguous</em> at finite relation types if the key appears
more than once in the finite relation. Otherwise, it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:lookupWithDefault" class="def">lookupWithDefault</a> :: a -> k -> m a -> a <a href="src/Data-Edison-Assoc.html#lookupWithDefault" class="link">Source</a> <a href="#v:lookupWithDefault" class="selflink">#</a></p><div class="doc"><p>Return the element associated with the given key. If no such element
is found, return the default.</p><p>This function is <em>ambiguous</em> at finite relation types if the key appears
more than once in the finite relation. Otherwise, it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:adjust" class="def">adjust</a> :: (a -> a) -> k -> m a -> m a <a href="src/Data-Edison-Assoc.html#adjust" class="link">Source</a> <a href="#v:adjust" class="selflink">#</a></p><div class="doc"><p>Change a single binding for the given key by applying a function to its
element. If the key binds more than one element, it is unspecified which
will be modified. If the key is not found in the collection, it is returned
unchanged.</p><p>This function is <em>ambiguous</em> at finite relation types if the key appears
more than once in the finite relation. Otherwise, it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:adjustAll" class="def">adjustAll</a> :: (a -> a) -> k -> m a -> m a <a href="src/Data-Edison-Assoc.html#adjustAll" class="link">Source</a> <a href="#v:adjustAll" class="selflink">#</a></p><div class="doc"><p>Change all bindings for the given key by applying a function to its
elements. If the key is not found in the collection, it is returned
unchanged.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:adjustOrInsert" class="def">adjustOrInsert</a> :: (a -> a) -> a -> k -> m a -> m a <a href="src/Data-Edison-Assoc.html#adjustOrInsert" class="link">Source</a> <a href="#v:adjustOrInsert" class="selflink">#</a></p><div class="doc"><p>Searches for a matching key in the collection. If the key is found,
the given function is called to adjust the value. If the key is not
found, a new binding is inserted with the given element. If the given
key is bound more than once in the collection, it is unspecified
which element is adjusted.</p><p>This function is <em>ambiguous</em> at finite relation types if the key appears
more than once in the finite relation. Otherwise, it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:adjustAllOrInsert" class="def">adjustAllOrInsert</a> :: (a -> a) -> a -> k -> m a -> m a <a href="src/Data-Edison-Assoc.html#adjustAllOrInsert" class="link">Source</a> <a href="#v:adjustAllOrInsert" class="selflink">#</a></p><div class="doc"><p>Searches for all matching keys in the collection. If the key is found,
the given function is applied to all its elements to adjust their values.
If the key is not found, a new binding is inserted with the given element.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:adjustOrDelete" class="def">adjustOrDelete</a> :: (a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> a) -> k -> m a -> m a <a href="src/Data-Edison-Assoc.html#adjustOrDelete" class="link">Source</a> <a href="#v:adjustOrDelete" class="selflink">#</a></p><div class="doc"><p>Change or delete a single binding for the given key by applying a function
to its element. If the function returns <code>Nothing</code>, then the binding
will be deleted. If the key binds more than one element, it is unspecified which
will be modified. If the key is not found in the collection, it is returned
unchanged.</p><p>This function is <em>ambiguous</em> at finite relation types if the key appears
more than once in the finite relation. Otherwise, it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:adjustOrDeleteAll" class="def">adjustOrDeleteAll</a> :: (a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Maybe.html#t:Maybe">Maybe</a> a) -> k -> m a -> m a <a href="src/Data-Edison-Assoc.html#adjustOrDeleteAll" class="link">Source</a> <a href="#v:adjustOrDeleteAll" class="selflink">#</a></p><div class="doc"><p>Change or delete all bindings for the given key by applying a function to
its elements. For any element where the function returns <code>Nothing</code>, the
corresponding binding is deleted. If the key is not found in the collection,
it is returned unchanged.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:fold" class="def">fold</a> :: (a -> b -> b) -> b -> m a -> b <a href="src/Data-Edison-Assoc.html#fold" class="link">Source</a> <a href="#v:fold" class="selflink">#</a></p><div class="doc"><p>Combine all the elements in the associative collection, given a combining
function and an initial value. The elements are processed in an
unspecified order. <em>Note</em> that <code><a href="Data-Edison-Assoc.html#v:fold">fold</a></code> ignores the keys.</p><p><code>fold f</code> is <em>unambiguous</em> iff <code>f</code> is fold-commutative.</p></div><p class="src"><a id="v:fold-39-" class="def">fold'</a> :: (a -> b -> b) -> b -> m a -> b <a href="src/Data-Edison-Assoc.html#fold%27" class="link">Source</a> <a href="#v:fold-39-" class="selflink">#</a></p><div class="doc"><p>A strict variant of <code><a href="Data-Edison-Assoc.html#v:fold">fold</a></code>.</p><p><code>fold' f</code> is <em>unambiguous</em> iff <code>f</code> is fold-commutative.</p></div><p class="src"><a id="v:fold1" class="def">fold1</a> :: (a -> a -> a) -> m a -> a <a href="src/Data-Edison-Assoc.html#fold1" class="link">Source</a> <a href="#v:fold1" class="selflink">#</a></p><div class="doc"><p>Combine all the elements in a non-empty associative collection using the
given combining function. Signals an error if the associative collection
is empty. The elements are processed in an unspecified order. An
implementation may choose to process the elements linearly or in a
balanced fashion (like <code>reduce1</code> on sequences). <em>Note</em> that <code><a href="Data-Edison-Assoc.html#v:fold1">fold1</a></code>
ignores the keys.</p><p><code>fold1 f</code> is <em>unambiguous</em> iff <code>f</code> is fold-commutative.</p></div><p class="src"><a id="v:fold1-39-" class="def">fold1'</a> :: (a -> a -> a) -> m a -> a <a href="src/Data-Edison-Assoc.html#fold1%27" class="link">Source</a> <a href="#v:fold1-39-" class="selflink">#</a></p><div class="doc"><p>A strict variant of <code><a href="Data-Edison-Assoc.html#v:fold1">fold1</a></code>.</p><p><code>fold1' f</code> is <em>unambiguous</em> iff <code>f</code> is fold-commutative.</p></div><p class="src"><a id="v:filter" class="def">filter</a> :: (a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -> m a -> m a <a href="src/Data-Edison-Assoc.html#filter" class="link">Source</a> <a href="#v:filter" class="selflink">#</a></p><div class="doc"><p>Extract all bindings whose elements satisfy the given predicate.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:partition" class="def">partition</a> :: (a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -> m a -> (m a, m a) <a href="src/Data-Edison-Assoc.html#partition" class="link">Source</a> <a href="#v:partition" class="selflink">#</a></p><div class="doc"><p>Split an associative collection into those bindings which satisfy the
given predicate, and those which do not.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:elements" class="def">elements</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => m a -> seq a <a href="src/Data-Edison-Assoc.html#elements" class="link">Source</a> <a href="#v:elements" class="selflink">#</a></p><div class="doc"><p>Returns all the elements in an associative collection, in an unspecified
order.</p><p>This function is <em>ambiguous</em> iff the associative collection contains
more than one element.</p></div><p class="src"><a id="v:strict" class="def">strict</a> :: m a -> m a <a href="src/Data-Edison-Assoc.html#strict" class="link">Source</a> <a href="#v:strict" class="selflink">#</a></p><div class="doc"><p>Semanticly, this function is a partial identity function. If the
datastructure is infinite in size or contains exceptions or non-termination
in the structure itself, then <code>strict</code> will result in bottom. Operationally,
this function walks the datastructure forcing any closures. Elements contained
in the map are <em>not</em> forced.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:strictWith" class="def">strictWith</a> :: (a -> b) -> m a -> m a <a href="src/Data-Edison-Assoc.html#strictWith" class="link">Source</a> <a href="#v:strictWith" class="selflink">#</a></p><div class="doc"><p>Similar to <code><a href="Data-Edison-Assoc.html#v:strict">strict</a></code>, this function walks the datastructure forcing closures.
However, <code>strictWith</code> will additionally apply the given function to the
map elements, force the result using <code>seq</code>, and then ignore it.
This function can be used to perform various levels of forcing on the
sequence elements. In particular:</p><pre>strictWith id xs</pre><p>will force the spine of the datastructure and reduce each element to WHNF.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:structuralInvariant" class="def">structuralInvariant</a> :: m a -> <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-Edison-Assoc.html#structuralInvariant" class="link">Source</a> <a href="#v:structuralInvariant" class="selflink">#</a></p><div class="doc"><p>A method to facilitate unit testing. 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 the structural
invariants of the implementation hold for the given associative
collection. If this function returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#v:False">False</a></code>, it represents a bug;
generally, either the implementation itself is flawed, or an unsafe
operation has been used while violating the preconditions.</p></div><p class="src"><a id="v:instanceName" class="def">instanceName</a> :: m a -> <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-Edison-Assoc.html#instanceName" class="link">Source</a> <a href="#v:instanceName" class="selflink">#</a></p><div class="doc"><p>Returns the name of the module implementing this associative collection.</p></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Ord.html#t:Ord">Ord</a> k) => <a id="t:OrdAssocX" class="def">OrdAssocX</a> m k | m -> k <span class="keyword">where</span> <a href="src/Data-Edison-Assoc.html#OrdAssocX" class="link">Source</a> <a href="#t:OrdAssocX" class="selflink">#</a></p><div class="doc"><p>An associative collection where the keys additionally have an ordering
relation.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Data-Edison-Assoc.html#v:minView">minView</a>, <a href="Data-Edison-Assoc.html#v:minElem">minElem</a>, <a href="Data-Edison-Assoc.html#v:deleteMin">deleteMin</a>, <a href="Data-Edison-Assoc.html#v:unsafeInsertMin">unsafeInsertMin</a>, <a href="Data-Edison-Assoc.html#v:maxView">maxView</a>, <a href="Data-Edison-Assoc.html#v:maxElem">maxElem</a>, <a href="Data-Edison-Assoc.html#v:deleteMax">deleteMax</a>, <a href="Data-Edison-Assoc.html#v:unsafeInsertMax">unsafeInsertMax</a>, <a href="Data-Edison-Assoc.html#v:foldr">foldr</a>, <a href="Data-Edison-Assoc.html#v:foldr-39-">foldr'</a>, <a href="Data-Edison-Assoc.html#v:foldl">foldl</a>, <a href="Data-Edison-Assoc.html#v:foldl-39-">foldl'</a>, <a href="Data-Edison-Assoc.html#v:foldr1">foldr1</a>, <a href="Data-Edison-Assoc.html#v:foldr1-39-">foldr1'</a>, <a href="Data-Edison-Assoc.html#v:foldl1">foldl1</a>, <a href="Data-Edison-Assoc.html#v:foldl1-39-">foldl1'</a>, <a href="Data-Edison-Assoc.html#v:unsafeFromOrdSeq">unsafeFromOrdSeq</a>, <a href="Data-Edison-Assoc.html#v:unsafeAppend">unsafeAppend</a>, <a href="Data-Edison-Assoc.html#v:filterLT">filterLT</a>, <a href="Data-Edison-Assoc.html#v:filterLE">filterLE</a>, <a href="Data-Edison-Assoc.html#v:filterGT">filterGT</a>, <a href="Data-Edison-Assoc.html#v:filterGE">filterGE</a>, <a href="Data-Edison-Assoc.html#v:partitionLT_GE">partitionLT_GE</a>, <a href="Data-Edison-Assoc.html#v:partitionLE_GT">partitionLE_GT</a>, <a href="Data-Edison-Assoc.html#v:partitionLT_GT">partitionLT_GT</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:minView" class="def">minView</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> rm => m a -> rm (a, m a) <a href="src/Data-Edison-Assoc.html#minView" class="link">Source</a> <a href="#v:minView" class="selflink">#</a></p><div class="doc"><p>Remove the binding with the minimum key, and return its element together
with the remaining associative collection. Calls <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#v:fail">fail</a></code> if the
associative collection is empty. Which binding is removed if there
is more than one minimum is unspecified.</p><p>This function is <em>ambiguous</em> at finite relation types if the finite relation
contains more than one minimum key. Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:minElem" class="def">minElem</a> :: m a -> a <a href="src/Data-Edison-Assoc.html#minElem" class="link">Source</a> <a href="#v:minElem" class="selflink">#</a></p><div class="doc"><p>Find the binding with the minimum key and return its element. Signals
an error if the associative collection is empty. Which element is chosen
if there is more than one minimum is unspecified.</p><p>This function is <em>ambiguous</em> at finite relation types if the finite relation
contains more than one minimum key. Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:deleteMin" class="def">deleteMin</a> :: m a -> m a <a href="src/Data-Edison-Assoc.html#deleteMin" class="link">Source</a> <a href="#v:deleteMin" class="selflink">#</a></p><div class="doc"><p>Remove the binding with the minimum key and return the remaining
associative collection, or return empty if it is already empty.</p><p>This function is <em>ambiguous</em> at finite relation types if the finite relation
contains more than one minimum key. Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:unsafeInsertMin" class="def">unsafeInsertMin</a> :: k -> a -> m a -> m a <a href="src/Data-Edison-Assoc.html#unsafeInsertMin" class="link">Source</a> <a href="#v:unsafeInsertMin" class="selflink">#</a></p><div class="doc"><p>Insert a binding into an associative collection with the precondition
that the given key is <code><=</code> any existing keys already in the collection.
For finite maps, this precondition is strengthened to <code><</code>.</p><p>This function is <em>unambiguous</em> under the preconditions.</p></div><p class="src"><a id="v:maxView" class="def">maxView</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> rm => m a -> rm (a, m a) <a href="src/Data-Edison-Assoc.html#maxView" class="link">Source</a> <a href="#v:maxView" class="selflink">#</a></p><div class="doc"><p>Remove the binding with the maximum key, and return its element together
with the remaining associative collection. Calls <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#v:fail">fail</a></code> if the
associative collection is empty. Which binding is removed if there
is more than one maximum is unspecified.</p><p>This function is <em>ambiguous</em> at finite relation types if the finite relation
contains more than one minimum key. Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:maxElem" class="def">maxElem</a> :: m a -> a <a href="src/Data-Edison-Assoc.html#maxElem" class="link">Source</a> <a href="#v:maxElem" class="selflink">#</a></p><div class="doc"><p>Find the binding with the maximum key and return its element. Signals
an error if the associative collection is empty. Which element is chosen
if there is more than one maximum is unspecified.</p><p>This function is <em>ambiguous</em> at finite relation types if the finite relation
contains more than one minimum key. Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:deleteMax" class="def">deleteMax</a> :: m a -> m a <a href="src/Data-Edison-Assoc.html#deleteMax" class="link">Source</a> <a href="#v:deleteMax" class="selflink">#</a></p><div class="doc"><p>Remove the binding with the maximum key and return the remaining
associative collection, or return empty if it is already empty.</p><p>This function is <em>ambiguous</em> at finite relation types if the finite relation
contains more than one minimum key. Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a id="v:unsafeInsertMax" class="def">unsafeInsertMax</a> :: k -> a -> m a -> m a <a href="src/Data-Edison-Assoc.html#unsafeInsertMax" class="link">Source</a> <a href="#v:unsafeInsertMax" class="selflink">#</a></p><div class="doc"><p>Insert a binding into an associative collection with the precondition
that the given key is <code>>=</code> any existing keys already in the collection.
For finite maps, this precondition is strengthened to <code>></code>.</p><p>This function is <em>unambiguous</em> under the precondition.</p></div><p class="src"><a id="v:foldr" class="def">foldr</a> :: (a -> b -> b) -> b -> m a -> b <a href="src/Data-Edison-Assoc.html#foldr" class="link">Source</a> <a href="#v:foldr" class="selflink">#</a></p><div class="doc"><p>Fold across the elements of an associative collection in non-decreasing
order by key with right associativity. For finite maps, the order
is increasing.</p><p><code>foldr f</code> is <em>unambiguous</em> if <code>f</code> is fold-commutative, at finite
map types, or at finite relation types if the relation contains no
duplicate keys. Otherwise it is <em>ambiguous</em>.</p></div><p class="src"><a id="v:foldr-39-" class="def">foldr'</a> :: (a -> b -> b) -> b -> m a -> b <a href="src/Data-Edison-Assoc.html#foldr%27" class="link">Source</a> <a href="#v:foldr-39-" class="selflink">#</a></p><div class="doc"><p>A strict variant of <code><a href="Data-Edison-Assoc.html#v:foldr">foldr</a></code>.</p><p><code>foldr' f</code> is <em>unambiguous</em> if <code>f</code> is fold-commutative, at finite
map types, or at finite relation types if the relation contains no
duplicate keys. Otherwise it is <em>ambiguous</em>.</p></div><p class="src"><a id="v:foldl" class="def">foldl</a> :: (b -> a -> b) -> b -> m a -> b <a href="src/Data-Edison-Assoc.html#foldl" class="link">Source</a> <a href="#v:foldl" class="selflink">#</a></p><div class="doc"><p>Fold across the elements of an associative collection in non-decreasing
order by key with left associativity. For finite maps, the order
is increasing.</p><p><code>foldl f</code> is <em>unambiguous</em> if <code>f</code> is fold-commutative, at finite
map types, or at finite relation types if the relation contains no
duplicate keys. Otherwise it is <em>ambiguous</em>.</p></div><p class="src"><a id="v:foldl-39-" class="def">foldl'</a> :: (b -> a -> b) -> b -> m a -> b <a href="src/Data-Edison-Assoc.html#foldl%27" class="link">Source</a> <a href="#v:foldl-39-" class="selflink">#</a></p><div class="doc"><p>A strict variant of <code><a href="Data-Edison-Assoc.html#v:foldl">foldl</a></code>.</p><p><code>foldl' f</code> is <em>unambiguous</em> if <code>f</code> is fold-commutative, at finite
map types, or at finite relation types if the relation contains no
duplicate keys. Otherwise it is <em>ambiguous</em>.</p></div><p class="src"><a id="v:foldr1" class="def">foldr1</a> :: (a -> a -> a) -> m a -> a <a href="src/Data-Edison-Assoc.html#foldr1" class="link">Source</a> <a href="#v:foldr1" class="selflink">#</a></p><div class="doc"><p>Fold across the elements of an associative collection in non-decreasing
order by key with right associativity. Signals an error if the
associative collection is empty. For finite maps, the order is
increasing.</p><p><code>foldr1 f</code> is <em>unambiguous</em> if <code>f</code> is fold-commutative, at finite
map types, or at finite relation types if the relation contains no
duplicate keys. Otherwise it is <em>ambiguous</em>.</p></div><p class="src"><a id="v:foldr1-39-" class="def">foldr1'</a> :: (a -> a -> a) -> m a -> a <a href="src/Data-Edison-Assoc.html#foldr1%27" class="link">Source</a> <a href="#v:foldr1-39-" class="selflink">#</a></p><div class="doc"><p>A strict variant of <code><a href="Data-Edison-Assoc.html#v:foldr1">foldr1</a></code>.</p><p><code>foldr1' f</code> is <em>unambiguous</em> if <code>f</code> is fold-commutative, at finite
map types, or at finite relation types if the relation contains no
duplicate keys. Otherwise it is <em>ambiguous</em>.</p></div><p class="src"><a id="v:foldl1" class="def">foldl1</a> :: (a -> a -> a) -> m a -> a <a href="src/Data-Edison-Assoc.html#foldl1" class="link">Source</a> <a href="#v:foldl1" class="selflink">#</a></p><div class="doc"><p>Fold across the elements of an associative collection in non-decreasing
order by key with left associativity. Signals an error if the
associative collection is empty. For finite maps, the order is
increasing.</p><p><code>foldl1 f</code> is <em>unambiguous</em> if <code>f</code> is fold-commutative, at finite
map types, or at finite relation types if the relation contains no
duplicate keys. Otherwise it is <em>ambiguous</em>.</p></div><p class="src"><a id="v:foldl1-39-" class="def">foldl1'</a> :: (a -> a -> a) -> m a -> a <a href="src/Data-Edison-Assoc.html#foldl1%27" class="link">Source</a> <a href="#v:foldl1-39-" class="selflink">#</a></p><div class="doc"><p>A strict variant of <code><a href="Data-Edison-Assoc.html#v:foldl1">foldl1</a></code>.</p><p><code>foldl1' f</code> is <em>unambiguous</em> if <code>f</code> is fold-commutative, at finite
map types, or at finite relation types if the relation contains no
duplicate keys. Otherwise it is <em>ambiguous</em>.</p></div><p class="src"><a id="v:unsafeFromOrdSeq" class="def">unsafeFromOrdSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => seq (k, a) -> m a <a href="src/Data-Edison-Assoc.html#unsafeFromOrdSeq" class="link">Source</a> <a href="#v:unsafeFromOrdSeq" class="selflink">#</a></p><div class="doc"><p>Convert a sequence of bindings into an associative collection with the
precondition that the sequence is sorted into non-decreasing order by
key. For finite maps, this precondition is strengthened to increasing
order.</p><p>This function is <em>unambiguous</em> under the precondition.</p></div><p class="src"><a id="v:unsafeAppend" class="def">unsafeAppend</a> :: m a -> m a -> m a <a href="src/Data-Edison-Assoc.html#unsafeAppend" class="link">Source</a> <a href="#v:unsafeAppend" class="selflink">#</a></p><div class="doc"><p>Merge two associative collections with the precondition that every key
in the first associative collection is <code><=</code> every key in the second
associative collection. For finite maps, this precondition is
strengthened to <code><</code>.</p><p>This function is <em>unambiguous</em> under the precondition.</p></div><p class="src"><a id="v:filterLT" class="def">filterLT</a> :: k -> m a -> m a <a href="src/Data-Edison-Assoc.html#filterLT" class="link">Source</a> <a href="#v:filterLT" class="selflink">#</a></p><div class="doc"><p>Extract all bindings whose keys are <code><</code> the given key.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:filterLE" class="def">filterLE</a> :: k -> m a -> m a <a href="src/Data-Edison-Assoc.html#filterLE" class="link">Source</a> <a href="#v:filterLE" class="selflink">#</a></p><div class="doc"><p>Extract all bindings whose keys are <code><=</code> the given key.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:filterGT" class="def">filterGT</a> :: k -> m a -> m a <a href="src/Data-Edison-Assoc.html#filterGT" class="link">Source</a> <a href="#v:filterGT" class="selflink">#</a></p><div class="doc"><p>Extract all bindings whose keys are <code>></code> the given key.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:filterGE" class="def">filterGE</a> :: k -> m a -> m a <a href="src/Data-Edison-Assoc.html#filterGE" class="link">Source</a> <a href="#v:filterGE" class="selflink">#</a></p><div class="doc"><p>Extract all bindings whose keys are <code>>=</code> the given key.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:partitionLT_GE" class="def">partitionLT_GE</a> :: k -> m a -> (m a, m a) <a href="src/Data-Edison-Assoc.html#partitionLT_GE" class="link">Source</a> <a href="#v:partitionLT_GE" class="selflink">#</a></p><div class="doc"><p>Split an associative collection into two sub-collections, containing
those bindings whose keys are <code><</code> the given key and those which are <code>>=</code>.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:partitionLE_GT" class="def">partitionLE_GT</a> :: k -> m a -> (m a, m a) <a href="src/Data-Edison-Assoc.html#partitionLE_GT" class="link">Source</a> <a href="#v:partitionLE_GT" class="selflink">#</a></p><div class="doc"><p>Split an associative collection into two sub-collections, containing
those bindings whose keys are <code><=</code> the given key and those which are <code>></code>.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:partitionLT_GT" class="def">partitionLT_GT</a> :: k -> m a -> (m a, m a) <a href="src/Data-Edison-Assoc.html#partitionLT_GT" class="link">Source</a> <a href="#v:partitionLT_GT" class="selflink">#</a></p><div class="doc"><p>Split an associative collection into two sub-collections, containing
those bindings whose keys are <code><</code> the given key and those which are <code>></code>.
All bindings with keys equal to the given key are discarded.</p><p>This function is always <em>unambiguous</em>.</p></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => <a id="t:FiniteMapX" class="def">FiniteMapX</a> m k | m -> k <span class="keyword">where</span> <a href="src/Data-Edison-Assoc.html#FiniteMapX" class="link">Source</a> <a href="#t:FiniteMapX" class="selflink">#</a></p><div class="doc"><p>An associative collection where the keys form a set; that is, each key
appears in the associative collection at most once.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Data-Edison-Assoc.html#v:fromSeqWith">fromSeqWith</a>, <a href="Data-Edison-Assoc.html#v:fromSeqWithKey">fromSeqWithKey</a>, <a href="Data-Edison-Assoc.html#v:insertWith">insertWith</a>, <a href="Data-Edison-Assoc.html#v:insertWithKey">insertWithKey</a>, <a href="Data-Edison-Assoc.html#v:insertSeqWith">insertSeqWith</a>, <a href="Data-Edison-Assoc.html#v:insertSeqWithKey">insertSeqWithKey</a>, <a href="Data-Edison-Assoc.html#v:unionl">unionl</a>, <a href="Data-Edison-Assoc.html#v:unionr">unionr</a>, <a href="Data-Edison-Assoc.html#v:unionWith">unionWith</a>, <a href="Data-Edison-Assoc.html#v:unionSeqWith">unionSeqWith</a>, <a href="Data-Edison-Assoc.html#v:intersectionWith">intersectionWith</a>, <a href="Data-Edison-Assoc.html#v:difference">difference</a>, <a href="Data-Edison-Assoc.html#v:properSubset">properSubset</a>, <a href="Data-Edison-Assoc.html#v:subset">subset</a>, <a href="Data-Edison-Assoc.html#v:submapBy">submapBy</a>, <a href="Data-Edison-Assoc.html#v:properSubmapBy">properSubmapBy</a>, <a href="Data-Edison-Assoc.html#v:sameMapBy">sameMapBy</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:fromSeqWith" class="def">fromSeqWith</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => (a -> a -> a) -> seq (k, a) -> m a <a href="src/Data-Edison-Assoc.html#fromSeqWith" class="link">Source</a> <a href="#v:fromSeqWith" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Assoc.html#v:fromSeq">fromSeq</a></code>, but with a combining function to resolve duplicates.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:fromSeqWithKey" class="def">fromSeqWithKey</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => (k -> a -> a -> a) -> seq (k, a) -> m a <a href="src/Data-Edison-Assoc.html#fromSeqWithKey" class="link">Source</a> <a href="#v:fromSeqWithKey" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Assoc.html#v:fromSeq">fromSeq</a></code>, but with a combining function to resolve duplicates;
the combining function takes the key in addition to the two elements.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:insertWith" class="def">insertWith</a> :: (a -> a -> a) -> k -> a -> m a -> m a <a href="src/Data-Edison-Assoc.html#insertWith" class="link">Source</a> <a href="#v:insertWith" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Assoc.html#v:insert">insert</a></code>, but with a combining function to resolve duplicates.</p><p>This function is <em>unambiguous</em>.</p></div><p class="src"><a id="v:insertWithKey" class="def">insertWithKey</a> :: (k -> a -> a -> a) -> k -> a -> m a -> m a <a href="src/Data-Edison-Assoc.html#insertWithKey" class="link">Source</a> <a href="#v:insertWithKey" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Assoc.html#v:insert">insert</a></code>, but with a combining function to resolve duplicates;
the combining function takes the key in addition to the two elements.
The key passed to the combining function is always the same as the
given key.</p><p>This function is <em>unambiguous</em>.</p></div><p class="src"><a id="v:insertSeqWith" class="def">insertSeqWith</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => (a -> a -> a) -> seq (k, a) -> m a -> m a <a href="src/Data-Edison-Assoc.html#insertSeqWith" class="link">Source</a> <a href="#v:insertSeqWith" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Assoc.html#v:insertSeq">insertSeq</a></code>, but with a combining function to resolve duplicates.</p><p>This function is <em>unambiguous</em>.</p></div><p class="src"><a id="v:insertSeqWithKey" class="def">insertSeqWithKey</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => (k -> a -> a -> a) -> seq (k, a) -> m a -> m a <a href="src/Data-Edison-Assoc.html#insertSeqWithKey" class="link">Source</a> <a href="#v:insertSeqWithKey" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Assoc.html#v:insertSeq">insertSeq</a></code>, but with a combining function to resolve duplicates;
the combining function takes the key in addition to the two elements.</p><p>This function is <em>unambiguous</em>.</p></div><p class="src"><a id="v:unionl" class="def">unionl</a> :: m a -> m a -> m a <a href="src/Data-Edison-Assoc.html#unionl" class="link">Source</a> <a href="#v:unionl" class="selflink">#</a></p><div class="doc"><p>Left biased union.</p><p><em>Axioms:</em></p><ul><li><pre>unionl = unionwith (\x y -> x)</pre></li></ul><p>This function is <em>unambiguous</em>.</p></div><p class="src"><a id="v:unionr" class="def">unionr</a> :: m a -> m a -> m a <a href="src/Data-Edison-Assoc.html#unionr" class="link">Source</a> <a href="#v:unionr" class="selflink">#</a></p><div class="doc"><p>Right biased union.</p><p><em>Axioms:</em></p><ul><li><pre>unionr = unionWith (\x y -> y)</pre></li></ul><p>This function is <em>unambiguous</em>.</p></div><p class="src"><a id="v:unionWith" class="def">unionWith</a> :: (a -> a -> a) -> m a -> m a -> m a <a href="src/Data-Edison-Assoc.html#unionWith" class="link">Source</a> <a href="#v:unionWith" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Assoc.html#v:union">union</a></code>, but with a combining function to resolve duplicates.</p><p>This function is <em>unambiguous</em>.</p></div><p class="src"><a id="v:unionSeqWith" class="def">unionSeqWith</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => (a -> a -> a) -> seq (m a) -> m a <a href="src/Data-Edison-Assoc.html#unionSeqWith" class="link">Source</a> <a href="#v:unionSeqWith" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Assoc.html#v:unionSeq">unionSeq</a></code>, but with a combining function to resolve duplicates.</p><p>This function is <em>unambiguous</em>.</p></div><p class="src"><a id="v:intersectionWith" class="def">intersectionWith</a> :: (a -> b -> c) -> m a -> m b -> m c <a href="src/Data-Edison-Assoc.html#intersectionWith" class="link">Source</a> <a href="#v:intersectionWith" class="selflink">#</a></p><div class="doc"><p>Compute the intersection of two finite maps. The resulting finite map
will contain bindings where the keys are the set intersection of the
keys in the argument finite maps. The combining function computes
the value of the element given the bound elements from the argument
finite maps.</p><p>This function is <em>unambiguous</em>.</p></div><p class="src"><a id="v:difference" class="def">difference</a> :: m a -> m b -> m a <a href="src/Data-Edison-Assoc.html#difference" class="link">Source</a> <a href="#v:difference" class="selflink">#</a></p><div class="doc"><p>Computes the difference of two finite maps; that is, all bindings
in the first finite map whose keys to not appear in the second.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:properSubset" class="def">properSubset</a> :: m a -> m b -> <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-Edison-Assoc.html#properSubset" class="link">Source</a> <a href="#v:properSubset" class="selflink">#</a></p><div class="doc"><p>Test whether the set of keys in the first finite map is a proper subset
of the set of keys of the second; that is, every key present in
the first finite map is also a member of the second finite map AND
there exists some key in the second finite map which is not present
in the first.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:subset" class="def">subset</a> :: m a -> m b -> <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-Edison-Assoc.html#subset" class="link">Source</a> <a href="#v:subset" class="selflink">#</a></p><div class="doc"><p>Test whether the set of keys in the first finite map is a subset of
the set of keys of the second; that is, if every key present in the first
finite map is also present in the second.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:submapBy" class="def">submapBy</a> :: (a -> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -> m a -> m a -> <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-Edison-Assoc.html#submapBy" class="link">Source</a> <a href="#v:submapBy" class="selflink">#</a></p><div class="doc"><p>Test whether the first map is a submap of the second map given a comparison
function on elements; that is, if every key present in the first map is also
present in the second map and the comparison function returns true when applied
two the bound elements.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:properSubmapBy" class="def">properSubmapBy</a> :: (a -> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -> m a -> m a -> <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-Edison-Assoc.html#properSubmapBy" class="link">Source</a> <a href="#v:properSubmapBy" class="selflink">#</a></p><div class="doc"><p>Test whether the first map is a proper submap of the second map given a comparison
function on elements; that is, if every key present in the first map is also
present in the second map and the comparison function returns true when applied
two the bound elements AND there exiss some key in the second finite map which
is not present in the first.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a id="v:sameMapBy" class="def">sameMapBy</a> :: (a -> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -> m a -> m a -> <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-Edison-Assoc.html#sameMapBy" class="link">Source</a> <a href="#v:sameMapBy" class="selflink">#</a></p><div class="doc"><p>Test whether the first map is the "same" map as the second map given a comparison
function on elements; that is, if the first and second maps have the same set of keys
and the comparison function returns true when applied to corresponding elements.</p><p>This function is always <em>unambiguous</em>.</p></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Data-Edison-Assoc.html#t:OrdAssocX">OrdAssocX</a> m k, <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k) => <a id="t:OrdFiniteMapX" class="def">OrdFiniteMapX</a> m k | m -> k <a href="src/Data-Edison-Assoc.html#OrdFiniteMapX" class="link">Source</a> <a href="#t:OrdFiniteMapX" class="selflink">#</a></p><div class="doc"><p>Finite maps where the keys additionally have an ordering relation.
This class introduces no new methods.</p></div></div><h1 id="g:3">Observable associative collections</h1><div class="top"><p class="src"><span class="keyword">class</span> <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => <a id="t:Assoc" class="def">Assoc</a> m k | m -> k <span class="keyword">where</span> <a href="src/Data-Edison-Assoc.html#Assoc" class="link">Source</a> <a href="#t:Assoc" class="selflink">#</a></p><div class="doc"><p>Associative collections where the keys are observable.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Data-Edison-Assoc.html#v:toSeq">toSeq</a>, <a href="Data-Edison-Assoc.html#v:keys">keys</a>, <a href="Data-Edison-Assoc.html#v:mapWithKey">mapWithKey</a>, <a href="Data-Edison-Assoc.html#v:foldWithKey">foldWithKey</a>, <a href="Data-Edison-Assoc.html#v:foldWithKey-39-">foldWithKey'</a>, <a href="Data-Edison-Assoc.html#v:filterWithKey">filterWithKey</a>, <a href="Data-Edison-Assoc.html#v:partitionWithKey">partitionWithKey</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:toSeq" class="def">toSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => m a -> seq (k, a) <a href="src/Data-Edison-Assoc.html#toSeq" class="link">Source</a> <a href="#v:toSeq" class="selflink">#</a></p><div class="doc"><p>Extract the bindings of an associative collection into a
sequence. The bindings are emitted in an unspecified order.</p><p>This function is <em>ambiguous</em> with respect to the sequence order
iff the associative collection contains more than one binding.
Furthermore, it is <em>ambiguous</em> with respect to the actual key
returned, unless the <code>Eq</code> instance on keys corresponds to
indistinguisability.</p></div><p class="src"><a id="v:keys" class="def">keys</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => m a -> seq k <a href="src/Data-Edison-Assoc.html#keys" class="link">Source</a> <a href="#v:keys" class="selflink">#</a></p><div class="doc"><p>Extract the keys of an associative collection into a sequence.
The keys are emitted in an unspecified order. For finite relations,
keys which appear multiple times in the relation will appear as many
times in the extracted sequence.</p><p>This function is <em>ambiguous</em> with respect to the sequence order
iff the associative collection contains more than one binding.
Furthermore, it is <em>ambiguous</em> with respect to the actual key
returned, unless the <code>Eq</code> instance on keys corresponds to
indistinguisability.</p></div><p class="src"><a id="v:mapWithKey" class="def">mapWithKey</a> :: (k -> a -> b) -> m a -> m b <a href="src/Data-Edison-Assoc.html#mapWithKey" class="link">Source</a> <a href="#v:mapWithKey" class="selflink">#</a></p><div class="doc"><p>Apply a function to every element in an associative collection. The
mapped function additionally takes the value of the key.</p><p>This function is <em>ambiguous</em> with respect to the actual keys
observed, unless the <code>Eq</code> instance on keys corresponds to
indistinguisability.</p></div><p class="src"><a id="v:foldWithKey" class="def">foldWithKey</a> :: (k -> a -> b -> b) -> b -> m a -> b <a href="src/Data-Edison-Assoc.html#foldWithKey" class="link">Source</a> <a href="#v:foldWithKey" class="selflink">#</a></p><div class="doc"><p>Combine all the elements in the associative collection, given a combining
function and an initial value. The elements are processed in an
unspecified order. The combining function additionally takes the
value of the key.</p><p><code>foldWithKey f</code> is <em>unambiguous</em> iff <code>f</code> is fold-commutative and
the <code>Eq</code> instance on keys corresponds to indistinguisability.</p></div><p class="src"><a id="v:foldWithKey-39-" class="def">foldWithKey'</a> :: (k -> a -> b -> b) -> b -> m a -> b <a href="src/Data-Edison-Assoc.html#foldWithKey%27" class="link">Source</a> <a href="#v:foldWithKey-39-" class="selflink">#</a></p><div class="doc"><p>A strict variant of <code><a href="Data-Edison-Assoc.html#v:foldWithKey">foldWithKey</a></code>.</p><p><code>foldWithKey' f</code> is <em>unambiguous</em> iff <code>f</code> is fold-commutative and
the <code>Eq</code> instance on keys corresponds to indistinguisability.</p></div><p class="src"><a id="v:filterWithKey" class="def">filterWithKey</a> :: (k -> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -> m a -> m a <a href="src/Data-Edison-Assoc.html#filterWithKey" class="link">Source</a> <a href="#v:filterWithKey" class="selflink">#</a></p><div class="doc"><p>Extract all bindings from an associative collection which satisfy the
given predicate.</p><p>This function is <em>ambiguous</em> with respect to the actual keys
observed, unless the <code>Eq</code> instance on keys corresponds to
indistinguisability.</p></div><p class="src"><a id="v:partitionWithKey" class="def">partitionWithKey</a> :: (k -> a -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a>) -> m a -> (m a, m a) <a href="src/Data-Edison-Assoc.html#partitionWithKey" class="link">Source</a> <a href="#v:partitionWithKey" class="selflink">#</a></p><div class="doc"><p>Split an associative collection into two sub-collections containing those
bindings which satisfy the given predicate and those which do not.</p><p>This function is <em>ambiguous</em> with respect to the actual keys
observed, unless the <code>Eq</code> instance on keys corresponds to
indistinguisability.</p></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Data-Edison-Assoc.html#t:Assoc">Assoc</a> m k, <a href="Data-Edison-Assoc.html#t:OrdAssocX">OrdAssocX</a> m k) => <a id="t:OrdAssoc" class="def">OrdAssoc</a> m k | m -> k <span class="keyword">where</span> <a href="src/Data-Edison-Assoc.html#OrdAssoc" class="link">Source</a> <a href="#t:OrdAssoc" class="selflink">#</a></p><div class="doc"><p>An associative collection with observable keys where the keys additionally
have an ordering relation.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Data-Edison-Assoc.html#v:minViewWithKey">minViewWithKey</a>, <a href="Data-Edison-Assoc.html#v:minElemWithKey">minElemWithKey</a>, <a href="Data-Edison-Assoc.html#v:maxViewWithKey">maxViewWithKey</a>, <a href="Data-Edison-Assoc.html#v:maxElemWithKey">maxElemWithKey</a>, <a href="Data-Edison-Assoc.html#v:foldrWithKey">foldrWithKey</a>, <a href="Data-Edison-Assoc.html#v:foldrWithKey-39-">foldrWithKey'</a>, <a href="Data-Edison-Assoc.html#v:foldlWithKey">foldlWithKey</a>, <a href="Data-Edison-Assoc.html#v:foldlWithKey-39-">foldlWithKey'</a>, <a href="Data-Edison-Assoc.html#v:toOrdSeq">toOrdSeq</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:minViewWithKey" class="def">minViewWithKey</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> rm => m a -> rm ((k, a), m a) <a href="src/Data-Edison-Assoc.html#minViewWithKey" class="link">Source</a> <a href="#v:minViewWithKey" class="selflink">#</a></p><div class="doc"><p>Delete the binding with the minimum key from an associative
collection and return the key, the element and the remaining
associative collection. Calls <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#v:fail">fail</a></code> if the associative collection
is empty. Which binding is chosen if there are multiple minimum keys
is unspecified.</p><p>This function is <em>ambiguous</em> at finite relation types if more than one
minimum key exists in the relation. Furthermore, it is <em>ambiguous</em>
with respect to the actual key observed unless the <code>Eq</code> instance on
keys corresponds to indistinguisability.</p></div><p class="src"><a id="v:minElemWithKey" class="def">minElemWithKey</a> :: m a -> (k, a) <a href="src/Data-Edison-Assoc.html#minElemWithKey" class="link">Source</a> <a href="#v:minElemWithKey" class="selflink">#</a></p><div class="doc"><p>Find the binding with the minimum key in an associative collection and
return the key and the element. Signals an error if the associative
collection is empty. Which binding is chosen if there are multiple
minimum keys is unspecified.</p><p>This function is <em>ambiguous</em> at finite relation types if more than one
minimum key exists in the relation. Furthermore, it is <em>ambiguous</em>
with respect to the actual key observed unless the <code>Eq</code> instance on
keys corresponds to indistinguisability.</p></div><p class="src"><a id="v:maxViewWithKey" class="def">maxViewWithKey</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#t:Monad">Monad</a> rm => m a -> rm ((k, a), m a) <a href="src/Data-Edison-Assoc.html#maxViewWithKey" class="link">Source</a> <a href="#v:maxViewWithKey" class="selflink">#</a></p><div class="doc"><p>Delete the binding with the maximum key from an associative
collection and return the key, the element and the remaining
associative collection. Calls <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Control-Monad.html#v:fail">fail</a></code> if the associative collection
is empty. Which binding is chosen if there are multiple maximum keys
is unspecified.</p><p>This function is <em>ambiguous</em> at finite relation types if more than one
maximum key exists in the relation. Furthermore, it is <em>ambiguous</em>
with respect to the actual key observed unless the <code>Eq</code> instance on
keys corresponds to indistinguisability.</p></div><p class="src"><a id="v:maxElemWithKey" class="def">maxElemWithKey</a> :: m a -> (k, a) <a href="src/Data-Edison-Assoc.html#maxElemWithKey" class="link">Source</a> <a href="#v:maxElemWithKey" class="selflink">#</a></p><div class="doc"><p>Find the binding with the maximum key in an associative collection and
return the key and the element. Signals an error if the associative
collection is empty. Which binding is chosen if there are multiple
maximum keys is unspecified.</p><p>This function is <em>ambiguous</em> at finite relation types if more than one
maximum key exists in the relation. Furthermore, it is <em>ambiguous</em>
with respect to the actual key observed unless the <code>Eq</code> instance on
keys corresponds to indistinguisability.</p></div><p class="src"><a id="v:foldrWithKey" class="def">foldrWithKey</a> :: (k -> a -> b -> b) -> b -> m a -> b <a href="src/Data-Edison-Assoc.html#foldrWithKey" class="link">Source</a> <a href="#v:foldrWithKey" class="selflink">#</a></p><div class="doc"><p>Fold over all bindings in an associative collection in non-decreasing
order by key with right associativity, given a combining function
and an initial value. For finite maps, the order is increasing.</p><p><code>foldrWithKey f</code> is <em>ambiguous</em> at finite relation types if
the relation contains more than one equivalent key and
<code>f</code> is not fold-commutative OR if the <code>Eq</code> instance on keys
does not correspond to indistingusihability.</p></div><p class="src"><a id="v:foldrWithKey-39-" class="def">foldrWithKey'</a> :: (k -> a -> b -> b) -> b -> m a -> b <a href="src/Data-Edison-Assoc.html#foldrWithKey%27" class="link">Source</a> <a href="#v:foldrWithKey-39-" class="selflink">#</a></p><div class="doc"><p>A strict variant of <code><a href="Data-Edison-Assoc.html#v:foldrWithKey">foldrWithKey</a></code>.</p><p><code>foldrWithKey' f</code> is <em>ambiguous</em> at finite relation types if
the relation contains more than one equivalent key and
<code>f</code> is not fold-commutative OR if the <code>Eq</code> instance on keys
does not correspond to indistingusihability. Otherwise it
is <em>unambiguous</em>.</p></div><p class="src"><a id="v:foldlWithKey" class="def">foldlWithKey</a> :: (b -> k -> a -> b) -> b -> m a -> b <a href="src/Data-Edison-Assoc.html#foldlWithKey" class="link">Source</a> <a href="#v:foldlWithKey" class="selflink">#</a></p><div class="doc"><p>Fold over all bindings in an associative collection in non-decreasing
order by key with left associativity, given a combining function
and an initial value. For finite maps, the order is increasing.</p><p><code>foldlWithKey f</code> is <em>ambiguous</em> at finite relation types if
the relation contains more than one equivalent key and
<code>f</code> is not fold-commutative OR if the <code>Eq</code> instance on keys
does not correspond to indistingusihability. Otherwise it
is <em>unambiguous</em>.</p></div><p class="src"><a id="v:foldlWithKey-39-" class="def">foldlWithKey'</a> :: (b -> k -> a -> b) -> b -> m a -> b <a href="src/Data-Edison-Assoc.html#foldlWithKey%27" class="link">Source</a> <a href="#v:foldlWithKey-39-" class="selflink">#</a></p><div class="doc"><p>A strict variant of <code><a href="Data-Edison-Assoc.html#v:foldlWithKey">foldlWithKey</a></code>.</p><p><code>foldlWithKey' f</code> is <em>ambiguous</em> at finite relation types if
the relation contains more than one equivalent key and
<code>f</code> is not fold-commutative OR if the <code>Eq</code> instance on keys
does not correspond to indistinguishability. Otherwise it
is <em>unambiguous</em>.</p></div><p class="src"><a id="v:toOrdSeq" class="def">toOrdSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => m a -> seq (k, a) <a href="src/Data-Edison-Assoc.html#toOrdSeq" class="link">Source</a> <a href="#v:toOrdSeq" class="selflink">#</a></p><div class="doc"><p>Extract the bindings of an associative collection into a sequence, where
the bindings are in non-decreasing order by key. For finite maps, this
is increasing order.</p><p>This function is <em>ambiguous</em> at finite relation types if the relation
contains more than one equivalent key, or if the <code>Eq</code> instance on
keys does not correspond to indistinguishability.</p></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Data-Edison-Assoc.html#t:Assoc">Assoc</a> m k, <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k) => <a id="t:FiniteMap" class="def">FiniteMap</a> m k | m -> k <span class="keyword">where</span> <a href="src/Data-Edison-Assoc.html#FiniteMap" class="link">Source</a> <a href="#t:FiniteMap" class="selflink">#</a></p><div class="doc"><p>Finite maps with observable keys.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Data-Edison-Assoc.html#v:unionWithKey">unionWithKey</a>, <a href="Data-Edison-Assoc.html#v:unionSeqWithKey">unionSeqWithKey</a>, <a href="Data-Edison-Assoc.html#v:intersectionWithKey">intersectionWithKey</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:unionWithKey" class="def">unionWithKey</a> :: (k -> a -> a -> a) -> m a -> m a -> m a <a href="src/Data-Edison-Assoc.html#unionWithKey" class="link">Source</a> <a href="#v:unionWithKey" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Assoc.html#v:union">union</a></code>, but with a combining function to resolve duplicates.
The combining function additionally takes the key. Which key is kept
and passed into the combining function is unspecified.</p><p>This function is <em>unambiguous</em> provided that the <code>Eq</code> instance on keys
corresponds to indistinguishability.</p></div><p class="src"><a id="v:unionSeqWithKey" class="def">unionSeqWithKey</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq => (k -> a -> a -> a) -> seq (m a) -> m a <a href="src/Data-Edison-Assoc.html#unionSeqWithKey" class="link">Source</a> <a href="#v:unionSeqWithKey" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Assoc.html#v:unionSeq">unionSeq</a></code>, but with a combining function to resolve duplicates.
The combining function additionally takes the key. Which key is
kept and passed into the combining function is unspecified.</p><p>This function is <em>unambiguous</em> provided that the <code>Eq</code> instance on keys
corresponds to indistinguishability.</p></div><p class="src"><a id="v:intersectionWithKey" class="def">intersectionWithKey</a> :: (k -> a -> b -> c) -> m a -> m b -> m c <a href="src/Data-Edison-Assoc.html#intersectionWithKey" class="link">Source</a> <a href="#v:intersectionWithKey" class="selflink">#</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Assoc.html#v:intersectionWith">intersectionWith</a></code>, except that the combining function
additionally takes the key value for each binding. Which key is
kept and passed into the combining function is unspecified.</p><p>This function is <em>unambiguous</em> provided the <code>Eq</code> instance on keys
corresponds to indistinguishability.</p></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Data-Edison-Assoc.html#t:OrdAssoc">OrdAssoc</a> m k, <a href="Data-Edison-Assoc.html#t:FiniteMap">FiniteMap</a> m k) => <a id="t:OrdFiniteMap" class="def">OrdFiniteMap</a> m k | m -> k <a href="src/Data-Edison-Assoc.html#OrdFiniteMap" class="link">Source</a> <a href="#t:OrdFiniteMap" class="selflink">#</a></p><div class="doc"><p>Finite maps with observable keys where the keys additionally
have an ordering relation. This class introduces no new methods.</p></div></div><h1 id="g:4">Specilizations of submap operations</h1><div class="top"><p class="src"><a id="v:submap" class="def">submap</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k) => m a -> m a -> <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-Edison-Assoc.html#submap" class="link">Source</a> <a href="#v:submap" class="selflink">#</a></p><div class="doc"><p>Specialization of <code><a href="Data-Edison-Assoc.html#v:submapBy">submapBy</a></code> where the comparison function is
given by <code>(==)</code>.</p></div></div><div class="top"><p class="src"><a id="v:properSubmap" class="def">properSubmap</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k) => m a -> m a -> <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-Edison-Assoc.html#properSubmap" class="link">Source</a> <a href="#v:properSubmap" class="selflink">#</a></p><div class="doc"><p>Specialization of <code><a href="Data-Edison-Assoc.html#v:properSubmapBy">properSubmapBy</a></code> where the comparison function
is given by <code>(==)</code>.</p></div></div><div class="top"><p class="src"><a id="v:sameMap" class="def">sameMap</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k) => m a -> m a -> <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-Edison-Assoc.html#sameMap" class="link">Source</a> <a href="#v:sameMap" class="selflink">#</a></p><div class="doc"><p>Specialization of <code><a href="Data-Edison-Assoc.html#v:sameMapBy">sameMapBy</a></code> where the comparison function is
given by <code>(==)</code>.</p></div></div><h1 id="g:5">Specializations of sequence operations to lists</h1><div class="top"><p class="src"><a id="v:fromList" class="def">fromList</a> :: <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => [(k, a)] -> m a <a href="src/Data-Edison-Assoc.html#fromList" class="link">Source</a> <a href="#v:fromList" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:insertList" class="def">insertList</a> :: <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => [(k, a)] -> m a -> m a <a href="src/Data-Edison-Assoc.html#insertList" class="link">Source</a> <a href="#v:insertList" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:unionList" class="def">unionList</a> :: <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => [m a] -> m a <a href="src/Data-Edison-Assoc.html#unionList" class="link">Source</a> <a href="#v:unionList" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:deleteList" class="def">deleteList</a> :: <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => [k] -> m a -> m a <a href="src/Data-Edison-Assoc.html#deleteList" class="link">Source</a> <a href="#v:deleteList" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:lookupList" class="def">lookupList</a> :: <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => k -> m a -> [a] <a href="src/Data-Edison-Assoc.html#lookupList" class="link">Source</a> <a href="#v:lookupList" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:elementsList" class="def">elementsList</a> :: <a href="Data-Edison-Assoc.html#t:AssocX">AssocX</a> m k => m a -> [a] <a href="src/Data-Edison-Assoc.html#elementsList" class="link">Source</a> <a href="#v:elementsList" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:unsafeFromOrdList" class="def">unsafeFromOrdList</a> :: <a href="Data-Edison-Assoc.html#t:OrdAssocX">OrdAssocX</a> m k => [(k, a)] -> m a <a href="src/Data-Edison-Assoc.html#unsafeFromOrdList" class="link">Source</a> <a href="#v:unsafeFromOrdList" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:fromListWith" class="def">fromListWith</a> :: <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k => (a -> a -> a) -> [(k, a)] -> m a <a href="src/Data-Edison-Assoc.html#fromListWith" class="link">Source</a> <a href="#v:fromListWith" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:fromListWithKey" class="def">fromListWithKey</a> :: <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k => (k -> a -> a -> a) -> [(k, a)] -> m a <a href="src/Data-Edison-Assoc.html#fromListWithKey" class="link">Source</a> <a href="#v:fromListWithKey" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:insertListWith" class="def">insertListWith</a> :: <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k => (a -> a -> a) -> [(k, a)] -> m a -> m a <a href="src/Data-Edison-Assoc.html#insertListWith" class="link">Source</a> <a href="#v:insertListWith" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:insertListWithKey" class="def">insertListWithKey</a> :: <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k => (k -> a -> a -> a) -> [(k, a)] -> m a -> m a <a href="src/Data-Edison-Assoc.html#insertListWithKey" class="link">Source</a> <a href="#v:insertListWithKey" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:unionListWith" class="def">unionListWith</a> :: <a href="Data-Edison-Assoc.html#t:FiniteMapX">FiniteMapX</a> m k => (a -> a -> a) -> [m a] -> m a <a href="src/Data-Edison-Assoc.html#unionListWith" class="link">Source</a> <a href="#v:unionListWith" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:toList" class="def">toList</a> :: <a href="Data-Edison-Assoc.html#t:Assoc">Assoc</a> m k => m a -> [(k, a)] <a href="src/Data-Edison-Assoc.html#toList" class="link">Source</a> <a href="#v:toList" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:keysList" class="def">keysList</a> :: <a href="Data-Edison-Assoc.html#t:Assoc">Assoc</a> m k => m a -> [k] <a href="src/Data-Edison-Assoc.html#keysList" class="link">Source</a> <a href="#v:keysList" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:toOrdList" class="def">toOrdList</a> :: <a href="Data-Edison-Assoc.html#t:OrdAssoc">OrdAssoc</a> m k => m a -> [(k, a)] <a href="src/Data-Edison-Assoc.html#toOrdList" class="link">Source</a> <a href="#v:toOrdList" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:unionListWithKey" class="def">unionListWithKey</a> :: <a href="Data-Edison-Assoc.html#t:FiniteMap">FiniteMap</a> m k => (k -> a -> a -> a) -> [m a] -> m a <a href="src/Data-Edison-Assoc.html#unionListWithKey" class="link">Source</a> <a href="#v:unionListWithKey" class="selflink">#</a></p></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>
|