This file is indexed.

/usr/share/doc/libghc-edison-api-doc/html/Data-Edison-Coll.html is in libghc-edison-api-doc 1.3-1.

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
<!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.Coll</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Data-Edison-Coll.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Data-Edison-Coll.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: A library of efficent, 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.Coll</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Superclass aliases</a><ul><li><a href="#g:2">Monoid</a></li></ul></li><li><a href="#g:3">Non-observable collections</a></li><li><a href="#g:4">Observable collections</a></li><li><a href="#g:5">Specializations of all the sequence operations to lists</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>The <em>collection</em> abstraction includes sets, bags and priority queues
   (heaps).  Collections are defined in Edison as a set of eight classes.</p><p>All collections assume at least an equality relation of elements, and
   may also assume an ordering relation.</p><p>The hierarchy contains a root class <code><a href="Data-Edison-Coll.html#t:CollX">CollX</a></code> together with seven
   subclasses satisfying one or more of three common sub-properties:</p><ul><li><em>Uniqueness</em> Each element in the collection is unique (no two
   elements in the collection are equal).  These subclasses, indicated
   by the name <code>Set</code>, represent sets rather than bags (multi-sets).</li><li><em>Ordering</em> The elements have a total ordering and it is possible to
   process the elements in non-decreasing order. These subclasses,
   indicates by the <code>Ord</code> prefix, typically represent either priority
   queues (heaps) or sets/bags implemented as binary search trees.</li><li><em>Observability</em> An observable collection is one in which it is
   possible to view the elements in a collection.  The <code>X</code> suffix
   indicates a lack of observability.  This property is discussed is
   greater detail below.</li></ul><p>Because collections encompass a wide range of abstractions, there is no
   single name that is suitable for all collection type constructors.
   However, most modules implementing collections will define a type
   constructor named either <code>Bag</code>, <code>Set</code>, or <code>Heap</code>.</p><p><em>Notes on observability</em></p><p>Note that the equality relation defined by the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a></code> class is not
   necessarily true equality.  Very often it is merely an equivalence
   relation, where two equivalent values may be distinguishable by other
   means.  For example, we might consider two binary trees to be equal
   if they contain the same elements, even if their shapes are different.</p><p>Because of this phenomenon, implementations of observable collections
   (ie, collections where it is possible to inspect the elements) are rather
   constrained.  Such an implementation must retain the actual elements that
   were inserted.  For example, it is not possible in general to represent an
   observable bag as a finite map from elements to counts, because even if we
   know that a given bag contains, say, three elements from some equivalence
   class, we do not necessarily know <em>which</em> three.</p><p>On the other hand, implementations of <em>non-observable</em> collections have
   much greater freedom to choose abstract representations of each
   equivalence class.  For example, representing a bag as a finite map from
   elements to counts works fine if we never need to know <em>which</em>
   representatives from an equivalence class are actually present.  As
   another example, consider the <code><a href="Data-Edison-Prelude.html#t:UniqueHash">UniqueHash</a></code> class defined in
   <a href="Data-Edison-Prelude.html">Data.Edison.Prelude</a>.  If we know that the <code><a href="Data-Edison-Prelude.html#v:hash">hash</a></code> function yields a 
   unique integer for each equivalence class, then we can represent a
   collection of hashable elements simply as a collection of integers.  With
   such a representation, we can still do many useful things like testing for
   membership; we just can't support functions like <code><a href="Data-Edison-Coll.html#v:fold">fold</a></code> or <code><a href="Data-Edison-Coll.html#v:filter">filter</a></code> that
   require the elements themselves, rather than the hashed values.</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:empty">empty</a> :: <a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a =&gt; c</li><li class="src short"><a href="#v:union">union</a> :: <a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a =&gt; c -&gt; c -&gt; c</li><li class="src short"><span class="keyword">class</span> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> c) =&gt; <a href="#t:CollX">CollX</a> c a | c -&gt; a <span class="keyword">where</span><ul class="subs"><li><a href="#v:singleton">singleton</a> :: a -&gt; c</li><li><a href="#v:fromSeq">fromSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; seq a -&gt; c</li><li><a href="#v:unionSeq">unionSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; seq c -&gt; c</li><li><a href="#v:insert">insert</a> :: a -&gt; c -&gt; c</li><li><a href="#v:insertSeq">insertSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; seq a -&gt; c -&gt; c</li><li><a href="#v:delete">delete</a> :: a -&gt; c -&gt; c</li><li><a href="#v:deleteAll">deleteAll</a> :: a -&gt; c -&gt; c</li><li><a href="#v:deleteSeq">deleteSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; seq a -&gt; c -&gt; c</li><li><a href="#v:null">null</a> :: c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li><a href="#v:size">size</a> :: c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a></li><li><a href="#v:member">member</a> :: a -&gt; c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li><a href="#v:count">count</a> :: a -&gt; c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a></li><li><a href="#v:strict">strict</a> :: c -&gt; c</li><li><a href="#v:structuralInvariant">structuralInvariant</a> :: c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li><a href="#v:instanceName">instanceName</a> :: c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></li></ul></li><li class="src short"><span class="keyword">class</span> (<a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Ord.html#t:Ord">Ord</a> a) =&gt; <a href="#t:OrdCollX">OrdCollX</a> c a | c -&gt; a <span class="keyword">where</span><ul class="subs"><li><a href="#v:deleteMin">deleteMin</a> :: c -&gt; c</li><li><a href="#v:deleteMax">deleteMax</a> :: c -&gt; c</li><li><a href="#v:unsafeInsertMin">unsafeInsertMin</a> :: a -&gt; c -&gt; c</li><li><a href="#v:unsafeInsertMax">unsafeInsertMax</a> :: a -&gt; c -&gt; c</li><li><a href="#v:unsafeFromOrdSeq">unsafeFromOrdSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; seq a -&gt; c</li><li><a href="#v:unsafeAppend">unsafeAppend</a> :: c -&gt; c -&gt; c</li><li><a href="#v:filterLT">filterLT</a> :: a -&gt; c -&gt; c</li><li><a href="#v:filterLE">filterLE</a> :: a -&gt; c -&gt; c</li><li><a href="#v:filterGT">filterGT</a> :: a -&gt; c -&gt; c</li><li><a href="#v:filterGE">filterGE</a> :: a -&gt; c -&gt; c</li><li><a href="#v:partitionLT_GE">partitionLT_GE</a> :: a -&gt; c -&gt; (c, c)</li><li><a href="#v:partitionLE_GT">partitionLE_GT</a> :: a -&gt; c -&gt; (c, c)</li><li><a href="#v:partitionLT_GT">partitionLT_GT</a> :: a -&gt; c -&gt; (c, c)</li></ul></li><li class="src short"><span class="keyword">class</span> <a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a =&gt; <a href="#t:SetX">SetX</a> c a | c -&gt; a <span class="keyword">where</span><ul class="subs"><li><a href="#v:intersection">intersection</a> :: c -&gt; c -&gt; c</li><li><a href="#v:difference">difference</a> :: c -&gt; c -&gt; c</li><li><a href="#v:symmetricDifference">symmetricDifference</a> :: c -&gt; c -&gt; c</li><li><a href="#v:properSubset">properSubset</a> :: c -&gt; c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li><li><a href="#v:subset">subset</a> :: c -&gt; c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a></li></ul></li><li class="src short"><span class="keyword">class</span> (<a href="Data-Edison-Coll.html#t:OrdCollX">OrdCollX</a> c a, <a href="Data-Edison-Coll.html#t:SetX">SetX</a> c a) =&gt; <a href="#t:OrdSetX">OrdSetX</a> c a | c -&gt; a</li><li class="src short"><span class="keyword">class</span> <a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a =&gt; <a href="#t:Coll">Coll</a> c a | c -&gt; a <span class="keyword">where</span><ul class="subs"><li><a href="#v:toSeq">toSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; c -&gt; seq a</li><li><a href="#v:lookup">lookup</a> :: a -&gt; c -&gt; a</li><li><a href="#v:lookupM">lookupM</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; a -&gt; c -&gt; m a</li><li><a href="#v:lookupAll">lookupAll</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; a -&gt; c -&gt; seq a</li><li><a href="#v:lookupWithDefault">lookupWithDefault</a> :: a -&gt; a -&gt; c -&gt; a</li><li><a href="#v:fold">fold</a> :: (a -&gt; b -&gt; b) -&gt; b -&gt; c -&gt; b</li><li><a href="#v:fold-39-">fold'</a> :: (a -&gt; b -&gt; b) -&gt; b -&gt; c -&gt; b</li><li><a href="#v:fold1">fold1</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; a</li><li><a href="#v:fold1-39-">fold1'</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; a</li><li><a href="#v:filter">filter</a> :: (a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; c -&gt; c</li><li><a href="#v:partition">partition</a> :: (a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; c -&gt; (c, c)</li><li><a href="#v:strictWith">strictWith</a> :: (a -&gt; b) -&gt; c -&gt; c</li></ul></li><li class="src short"><span class="keyword">class</span> (<a href="Data-Edison-Coll.html#t:Coll">Coll</a> c a, <a href="Data-Edison-Coll.html#t:OrdCollX">OrdCollX</a> c a) =&gt; <a href="#t:OrdColl">OrdColl</a> c a | c -&gt; a <span class="keyword">where</span><ul class="subs"><li><a href="#v:minView">minView</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; c -&gt; m (a, c)</li><li><a href="#v:minElem">minElem</a> :: c -&gt; a</li><li><a href="#v:maxView">maxView</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; c -&gt; m (a, c)</li><li><a href="#v:maxElem">maxElem</a> :: c -&gt; a</li><li><a href="#v:foldr">foldr</a> :: (a -&gt; b -&gt; b) -&gt; b -&gt; c -&gt; b</li><li><a href="#v:foldr-39-">foldr'</a> :: (a -&gt; b -&gt; b) -&gt; b -&gt; c -&gt; b</li><li><a href="#v:foldl">foldl</a> :: (b -&gt; a -&gt; b) -&gt; b -&gt; c -&gt; b</li><li><a href="#v:foldl-39-">foldl'</a> :: (b -&gt; a -&gt; b) -&gt; b -&gt; c -&gt; b</li><li><a href="#v:foldr1">foldr1</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; a</li><li><a href="#v:foldr1-39-">foldr1'</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; a</li><li><a href="#v:foldl1">foldl1</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; a</li><li><a href="#v:foldl1-39-">foldl1'</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; a</li><li><a href="#v:toOrdSeq">toOrdSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; c -&gt; seq a</li><li><a href="#v:unsafeMapMonotonic">unsafeMapMonotonic</a> :: (a -&gt; a) -&gt; c -&gt; c</li></ul></li><li class="src short"><span class="keyword">class</span> (<a href="Data-Edison-Coll.html#t:Coll">Coll</a> c a, <a href="Data-Edison-Coll.html#t:SetX">SetX</a> c a) =&gt; <a href="#t:Set">Set</a> c a | c -&gt; a <span class="keyword">where</span><ul class="subs"><li><a href="#v:fromSeqWith">fromSeqWith</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; (a -&gt; a -&gt; a) -&gt; seq a -&gt; c</li><li><a href="#v:insertWith">insertWith</a> :: (a -&gt; a -&gt; a) -&gt; a -&gt; c -&gt; c</li><li><a href="#v:insertSeqWith">insertSeqWith</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; (a -&gt; a -&gt; a) -&gt; seq a -&gt; c -&gt; c</li><li><a href="#v:unionl">unionl</a> :: c -&gt; c -&gt; c</li><li><a href="#v:unionr">unionr</a> :: c -&gt; c -&gt; c</li><li><a href="#v:unionWith">unionWith</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; c -&gt; c</li><li><a href="#v:unionSeqWith">unionSeqWith</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; (a -&gt; a -&gt; a) -&gt; seq c -&gt; c</li><li><a href="#v:intersectionWith">intersectionWith</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; c -&gt; c</li></ul></li><li class="src short"><span class="keyword">class</span> (<a href="Data-Edison-Coll.html#t:OrdColl">OrdColl</a> c a, <a href="Data-Edison-Coll.html#t:Set">Set</a> c a) =&gt; <a href="#t:OrdSet">OrdSet</a> c a | c -&gt; a</li><li class="src short"><a href="#v:fromList">fromList</a> :: <a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a =&gt; [a] -&gt; c</li><li class="src short"><a href="#v:insertList">insertList</a> :: <a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a =&gt; [a] -&gt; c -&gt; c</li><li class="src short"><a href="#v:unionList">unionList</a> :: <a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a =&gt; [c] -&gt; c</li><li class="src short"><a href="#v:deleteList">deleteList</a> :: <a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a =&gt; [a] -&gt; c -&gt; c</li><li class="src short"><a href="#v:unsafeFromOrdList">unsafeFromOrdList</a> :: <a href="Data-Edison-Coll.html#t:OrdCollX">OrdCollX</a> c a =&gt; [a] -&gt; c</li><li class="src short"><a href="#v:toList">toList</a> :: <a href="Data-Edison-Coll.html#t:Coll">Coll</a> c a =&gt; c -&gt; [a]</li><li class="src short"><a href="#v:lookupList">lookupList</a> :: <a href="Data-Edison-Coll.html#t:Coll">Coll</a> c a =&gt; a -&gt; c -&gt; [a]</li><li class="src short"><a href="#v:toOrdList">toOrdList</a> :: <a href="Data-Edison-Coll.html#t:OrdColl">OrdColl</a> c a =&gt; c -&gt; [a]</li><li class="src short"><a href="#v:fromListWith">fromListWith</a> :: <a href="Data-Edison-Coll.html#t:Set">Set</a> c a =&gt; (a -&gt; a -&gt; a) -&gt; [a] -&gt; c</li><li class="src short"><a href="#v:insertListWith">insertListWith</a> :: <a href="Data-Edison-Coll.html#t:Set">Set</a> c a =&gt; (a -&gt; a -&gt; a) -&gt; [a] -&gt; c -&gt; c</li><li class="src short"><a href="#v:unionListWith">unionListWith</a> :: <a href="Data-Edison-Coll.html#t:Set">Set</a> c a =&gt; (a -&gt; a -&gt; a) -&gt; [c] -&gt; c</li></ul></div><div id="interface"><h1 id="g:1">Superclass aliases</h1><h2 id="g:2">Monoid</h2><div class="top"><p class="src"><a name="v:empty" class="def">empty</a> :: <a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a =&gt; c <a href="src/Data-Edison-Coll.html#empty" class="link">Source</a></p><div class="doc"><p>The empty collection.  Equivalant to <code>mempty</code> from
   the <code>Monoid</code> instance.</p><p>This function is always <em>unambiguous</em>.</p></div></div><div class="top"><p class="src"><a name="v:union" class="def">union</a> :: <a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a =&gt; c -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#union" class="link">Source</a></p><div class="doc"><p>Merge two collections.  For sets, it is unspecified which element is
   kept in the case of duplicates.  Equivalant to <code>mappend</code> from the
   <code>Monoid</code> instance.</p><p>This function is <em>ambiguous</em> at set types if the sets are not disjoint.
   Otherwise it is <em>unambiguous</em>.</p></div></div><h1 id="g:3">Non-observable 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.8.2.0/Data-Eq.html#t:Eq">Eq</a> a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Monoid.html#t:Monoid">Monoid</a> c) =&gt; <a name="t:CollX" class="def">CollX</a> c a | c -&gt; a <span class="keyword">where</span> <a href="src/Data-Edison-Coll.html#CollX" class="link">Source</a></p><div class="doc"><p>This is the root class of the collection hierarchy.  However, it
   is perfectly adequate for many applications that use sets or bags.</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:singleton" class="def">singleton</a> :: a -&gt; c <a href="src/Data-Edison-Coll.html#singleton" class="link">Source</a></p><div class="doc"><p>create a singleton collection</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:fromSeq" class="def">fromSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; seq a -&gt; c <a href="src/Data-Edison-Coll.html#fromSeq" class="link">Source</a></p><div class="doc"><p>Convert a sequence to a collection.  For sets, it is unspecified
   which element is kept in case of duplicates.</p><p>This function is <em>ambiguous</em> at set types if more than one
   equivalent item is in the sequence.  Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a name="v:unionSeq" class="def">unionSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; seq c -&gt; c <a href="src/Data-Edison-Coll.html#unionSeq" class="link">Source</a></p><div class="doc"><p>Merge a sequence of collections.  For sets, it is unspecified which
   element is kept in the case of duplicates.</p><p>This function is <em>ambiguous</em> at set types if the sets in the sequence
   are not mutually disjoint. Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a name="v:insert" class="def">insert</a> :: a -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#insert" class="link">Source</a></p><div class="doc"><p>Insert an element into a collection.  For sets, if an equal element
   is already in the set, the newly inserted element is kept, and the
   old element is discarded.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:insertSeq" class="def">insertSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; seq a -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#insertSeq" class="link">Source</a></p><div class="doc"><p>Insert a sequence of elements into a collection.  For sets,
   the behavior with regard to multiple equal elements is unspecified.</p><p>This function is <em>ambiguous</em> at set types if the sequence contains
   more than one equivalent item or an item which is already in the set.
   Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a name="v:delete" class="def">delete</a> :: a -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#delete" class="link">Source</a></p><div class="doc"><p>Delete a single occurrence of the given element from a collection.
   For bags, it is unspecified which element will be deleted.</p><p>This function is <em>ambiguous</em> at bag types if more than one item exists
   in the bag equivalent to the given item.  Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a name="v:deleteAll" class="def">deleteAll</a> :: a -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#deleteAll" class="link">Source</a></p><div class="doc"><p>Delete all occurrences of an element from a collection.  For sets
   this operation is identical to <code><a href="Data-Edison-Coll.html#v:delete">delete</a></code>.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:deleteSeq" class="def">deleteSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; seq a -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#deleteSeq" class="link">Source</a></p><div class="doc"><p>Delete a single occurrence of each of the given elements from
   a collection.  For bags, there may be multiple occurrences of a
   given element in the collection, in which case it is unspecified
   which is deleted.</p><p>This function is <em>ambiguous</em> at bag types if more than one item
   exists in the bag equivalent to any item in the list and the number
   of equivalent occurrences of that item in the sequence is less than
   the number of occurrences in the bag.  Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a name="v:null" class="def">null</a> :: c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Data-Edison-Coll.html#null" class="link">Source</a></p><div class="doc"><p>Test whether the collection is empty.</p><p><em>Axioms:</em></p><ul><li><pre>null xs = (size xs == 0)</pre></li></ul><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:size" class="def">size</a> :: c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a> <a href="src/Data-Edison-Coll.html#size" class="link">Source</a></p><div class="doc"><p>Return the number of elements in the collection.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:member" class="def">member</a> :: a -&gt; c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Data-Edison-Coll.html#member" class="link">Source</a></p><div class="doc"><p>Test whether the given element is in the collection.</p><p><em>Axioms:</em></p><ul><li><pre>member x xs = (count x xs &gt; 0)</pre></li></ul><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:count" class="def">count</a> :: a -&gt; c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Int.html#t:Int">Int</a> <a href="src/Data-Edison-Coll.html#count" class="link">Source</a></p><div class="doc"><p>Count how many copies of the given element are in the collection.
   For sets, this will always return 0 or 1.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:strict" class="def">strict</a> :: c -&gt; c <a href="src/Data-Edison-Coll.html#strict" class="link">Source</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.  In many
   collections, the collction &quot;shape&quot; depends on the value of the elemnts;
   in such cases, the values of the elements will be forced to the extent
   necessary to force the structure of the collection, but no further.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:structuralInvariant" class="def">structuralInvariant</a> :: c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Data-Edison-Coll.html#structuralInvariant" class="link">Source</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.8.2.0/Data-Bool.html#v:True">True</a></code> if the structural
   invariants of the implementation hold for the given collection.  If
   this function returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.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 name="v:instanceName" class="def">instanceName</a> :: c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> <a href="src/Data-Edison-Coll.html#instanceName" class="link">Source</a></p><div class="doc"><p>The name of the module implementing <code>c</code></p></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Ord.html#t:Ord">Ord</a> a) =&gt; <a name="t:OrdCollX" class="def">OrdCollX</a> c a | c -&gt; a <span class="keyword">where</span> <a href="src/Data-Edison-Coll.html#OrdCollX" class="link">Source</a></p><div class="doc"><p>Collections for which the elements have an ordering relation.</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:deleteMin" class="def">deleteMin</a> :: c -&gt; c <a href="src/Data-Edison-Coll.html#deleteMin" class="link">Source</a></p><div class="doc"><p>Delete the minimum element from the collection.  If there is more
   than one minimum, it is unspecified which is deleted.  If the collection
   is empty, it will be returned unchanged.</p><p>This function is <em>ambiguous</em> at bag types if more than one minimum
   element exists in the bag.  Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a name="v:deleteMax" class="def">deleteMax</a> :: c -&gt; c <a href="src/Data-Edison-Coll.html#deleteMax" class="link">Source</a></p><div class="doc"><p>Delete the maximum element from the collection.  If there is more
   than one maximum, it is unspecified which is deleted.  If the collection
   is empty, it will be returned unchanged.</p><p>This function is <em>ambiguous</em> at bag types if more than one maximum
   element exists in the bag.  Otherwise it is <em>unambiguous</em>.</p></div><p class="src"><a name="v:unsafeInsertMin" class="def">unsafeInsertMin</a> :: a -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#unsafeInsertMin" class="link">Source</a></p><div class="doc"><p>Insert an element into a collection which is guaranteed to be
   <code>&lt;=</code> any existing elements in the collection.  For sets, the
   precondition is strengthened to <code>&lt;</code>.</p><p>This function is <em>unambiguous</em>, under the above preconditions.</p></div><p class="src"><a name="v:unsafeInsertMax" class="def">unsafeInsertMax</a> :: a -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#unsafeInsertMax" class="link">Source</a></p><div class="doc"><p>Insert an element into a collection which is guaranteed to be
   <code>&gt;=</code> any existing elements in the collection.  For sets, the 
   precondition is strengthened to <code>&gt;</code>.</p><p>This function is <em>unambiguous</em>, under the above preconditions.</p></div><p class="src"><a name="v:unsafeFromOrdSeq" class="def">unsafeFromOrdSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; seq a -&gt; c <a href="src/Data-Edison-Coll.html#unsafeFromOrdSeq" class="link">Source</a></p><div class="doc"><p>Convert a sequence in non-decreasing order into a collection.
   For sets, the sequence must be in increasing order.</p><p>This function is <em>unambiguous</em>, under the above preconditions.</p></div><p class="src"><a name="v:unsafeAppend" class="def">unsafeAppend</a> :: c -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#unsafeAppend" class="link">Source</a></p><div class="doc"><p>Union two collections where every element in the first
   collection is <code>&lt;=</code> every element in the second collection.
   For sets, this precondition is strengthened to <code>&lt;</code>.</p><p>This function is <em>unambiguous</em>, under the above preconditions.</p></div><p class="src"><a name="v:filterLT" class="def">filterLT</a> :: a -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#filterLT" class="link">Source</a></p><div class="doc"><p>Extract the sub-collection of elements <code>&lt;</code> the given element.</p><p><em>Axioms:</em></p><ul><li><pre>filterLT x xs = filter (&lt; x) xs</pre></li></ul><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:filterLE" class="def">filterLE</a> :: a -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#filterLE" class="link">Source</a></p><div class="doc"><p>Extract the sub-collection of elements <code>&lt;=</code> the given element.</p><p><em>Axioms:</em></p><ul><li><pre>filterLE x xs = filter (&lt;= x) xs</pre></li></ul><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:filterGT" class="def">filterGT</a> :: a -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#filterGT" class="link">Source</a></p><div class="doc"><p>Extract the sub-collection of elements <code>&gt;</code> the given element.</p><p><em>Axioms:</em></p><ul><li><pre>filterGT x xs = filter (&gt; x) xs</pre></li></ul><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:filterGE" class="def">filterGE</a> :: a -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#filterGE" class="link">Source</a></p><div class="doc"><p>Extract the sub-collection of elements <code>&gt;=</code> the given element.</p><p><em>Axioms:</em></p><ul><li><pre>filterGE x xs = filter (&gt;= x) xs</pre></li></ul><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:partitionLT_GE" class="def">partitionLT_GE</a> :: a -&gt; c -&gt; (c, c) <a href="src/Data-Edison-Coll.html#partitionLT_GE" class="link">Source</a></p><div class="doc"><p>Split a collection into those elements <code>&lt;</code> a given element and
   those <code>&gt;=</code>.</p><p><em>Axioms:</em></p><ul><li><pre>partitionLT_GE xs = partition (&lt;) xs</pre></li></ul><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:partitionLE_GT" class="def">partitionLE_GT</a> :: a -&gt; c -&gt; (c, c) <a href="src/Data-Edison-Coll.html#partitionLE_GT" class="link">Source</a></p><div class="doc"><p>Split a collection into those elements <code>&lt;=</code> a given element and
   those <code>&gt;</code>.</p><p><em>Axioms:</em></p><ul><li><pre>partitionLE_GT xs = partition (&lt;=) xs</pre></li></ul><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:partitionLT_GT" class="def">partitionLT_GT</a> :: a -&gt; c -&gt; (c, c) <a href="src/Data-Edison-Coll.html#partitionLT_GT" class="link">Source</a></p><div class="doc"><p>Split a collection into those elements <code>&lt;</code> a given element and
   those <code>&gt;</code>.  All elements equal to the given element are discarded.</p><p><em>Axioms:</em></p><ul><li><pre>partitionLT_GT x xs = (filterLT x xs,filterGT x xs)</pre></li></ul><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-Coll.html#t:CollX">CollX</a> c a =&gt; <a name="t:SetX" class="def">SetX</a> c a | c -&gt; a <span class="keyword">where</span> <a href="src/Data-Edison-Coll.html#SetX" class="link">Source</a></p><div class="doc"><p>A collection where the set property is maintained; that is, a set
   contains at most one element of the equivalence class formed by the
   <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a></code> instance on the elements.</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:intersection" class="def">intersection</a> :: c -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#intersection" class="link">Source</a></p><div class="doc"><p>Computes the intersection of two sets.  It is unspecified which 
   element is kept when equal elements appear in each set.</p><p>This function is <em>ambiguous</em>, except when the sets are disjoint.</p></div><p class="src"><a name="v:difference" class="def">difference</a> :: c -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#difference" class="link">Source</a></p><div class="doc"><p>Computes the difference of two sets; that is, all elements in
   the first set which are not in the second set.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:symmetricDifference" class="def">symmetricDifference</a> :: c -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#symmetricDifference" class="link">Source</a></p><div class="doc"><p>Computes the symmetric difference of two sets; that is, all elements
   which appear in exactily one of the two sets.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:properSubset" class="def">properSubset</a> :: c -&gt; c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Data-Edison-Coll.html#properSubset" class="link">Source</a></p><div class="doc"><p>Test whether the first set is a proper subset of the second set;
   that is, if every element in the first set is also a member of the
   second set AND there exists some element in the second set which
   is not present in the first.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:subset" class="def">subset</a> :: c -&gt; c -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Data-Edison-Coll.html#subset" class="link">Source</a></p><div class="doc"><p>Test whether the first set is a subset of the second set; that is, if
   every element in the first set is also a member of the second set.</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-Coll.html#t:OrdCollX">OrdCollX</a> c a, <a href="Data-Edison-Coll.html#t:SetX">SetX</a> c a) =&gt; <a name="t:OrdSetX" class="def">OrdSetX</a> c a | c -&gt; a <a href="src/Data-Edison-Coll.html#OrdSetX" class="link">Source</a></p><div class="doc"><p>Sets where the elements also have an ordering relation.
   This class contains no methods; it is only an abbreviation for
   the context <code>(OrdCollX c a,SetX c a)</code>.</p></div></div><h1 id="g:4">Observable collections</h1><div class="top"><p class="src"><span class="keyword">class</span> <a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a =&gt; <a name="t:Coll" class="def">Coll</a> c a | c -&gt; a <span class="keyword">where</span> <a href="src/Data-Edison-Coll.html#Coll" class="link">Source</a></p><div class="doc"><p>Collections with observable elements.  See the module documentation for
   comments on observability.</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:toSeq" class="def">toSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; c -&gt; seq a <a href="src/Data-Edison-Coll.html#toSeq" class="link">Source</a></p><div class="doc"><p>List the elements of the collection in an unspecified order.</p><p>This function is <em>ambiguous</em> iff the collection contains more
   than one element.</p></div><p class="src"><a name="v:lookup" class="def">lookup</a> :: a -&gt; c -&gt; a <a href="src/Data-Edison-Coll.html#lookup" class="link">Source</a></p><div class="doc"><p>Lookup one element equal to the given element.  If no elements
   exist in the collection equal to the given element, an error is
   signaled.  If multiple copies of the given element exist in the
   collection, it is unspecified which is returned.</p><p>This function is <em>ambiguous</em> at bag types, when more than one
   element equivalent to the given item is in the bag.  Otherwise
   it is <em>unambiguous</em>.</p></div><p class="src"><a name="v:lookupM" class="def">lookupM</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; a -&gt; c -&gt; m a <a href="src/Data-Edison-Coll.html#lookupM" class="link">Source</a></p><div class="doc"><p>Lookup one element equal to the given element.  If no elements
   exist in the collection equal to the given element, <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#v:fail">fail</a></code> is called.
   If multiple copies of the given element exist in the collection, it
   is unspecified which is returned.</p><p>This function is <em>ambiguous</em> at bag types, when more than one
   element equivalent to the given item is in the bag.  Otherwise
   it is <em>unambiguous</em>.</p></div><p class="src"><a name="v:lookupAll" class="def">lookupAll</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; a -&gt; c -&gt; seq a <a href="src/Data-Edison-Coll.html#lookupAll" class="link">Source</a></p><div class="doc"><p>Return a sequence containing all elements in the collection equal to
   the given element in an unspecified order.</p><p>This function is <em>ambiguous</em> at bag types, when more than one
   element equivalent to the given item is in the bag.  Otherwise
   it is <em>unambiguous</em>.</p></div><p class="src"><a name="v:lookupWithDefault" class="def">lookupWithDefault</a> <a href="src/Data-Edison-Coll.html#lookupWithDefault" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: a</td><td class="doc"><p>default element</p></td></tr><tr><td class="src">-&gt; a</td><td class="doc"><p>element to lookup</p></td></tr><tr><td class="src">-&gt; c</td><td class="doc"><p>collection</p></td></tr><tr><td class="src">-&gt; a</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Lookup one element equal to the (second) given element in the collection.
   If no elements exist in the collection equal to the given element, then
   the default element is returned.</p><p>This function is <em>ambiguous</em> at bag types, when more than one
   element equivalent to the given item is in the bag.  Otherwise
   it is <em>unambiguous</em>.</p></div><p class="src"><a name="v:fold" class="def">fold</a> :: (a -&gt; b -&gt; b) -&gt; b -&gt; c -&gt; b <a href="src/Data-Edison-Coll.html#fold" class="link">Source</a></p><div class="doc"><p>Fold over all the elements in a collection in an unspecified order.</p><p><code>fold f</code> is <em>unambiguous</em> iff <code>f</code> is fold-commutative.</p></div><p class="src"><a name="v:fold-39-" class="def">fold'</a> :: (a -&gt; b -&gt; b) -&gt; b -&gt; c -&gt; b <a href="src/Data-Edison-Coll.html#fold%27" class="link">Source</a></p><div class="doc"><p>A strict variant of <code><a href="Data-Edison-Coll.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 name="v:fold1" class="def">fold1</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; a <a href="src/Data-Edison-Coll.html#fold1" class="link">Source</a></p><div class="doc"><p>Fold over all the elements in a collection in an unspecified order.
   An error is signaled if the collection is empty.</p><p><code>fold1 f</code> is <em>unambiguous</em> iff <code>f</code> is fold-commutative.</p></div><p class="src"><a name="v:fold1-39-" class="def">fold1'</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; a <a href="src/Data-Edison-Coll.html#fold1%27" class="link">Source</a></p><div class="doc"><p>A strict variant of <code><a href="Data-Edison-Coll.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 name="v:filter" class="def">filter</a> :: (a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#filter" class="link">Source</a></p><div class="doc"><p>Remove all elements not satisfying the predicate.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:partition" class="def">partition</a> :: (a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Bool.html#t:Bool">Bool</a>) -&gt; c -&gt; (c, c) <a href="src/Data-Edison-Coll.html#partition" class="link">Source</a></p><div class="doc"><p>Returns two collections, the first containing all the elements
   satisfying the predicate, and the second containing all the
   elements not satisfying the predicate.</p><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:strictWith" class="def">strictWith</a> :: (a -&gt; b) -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#strictWith" class="link">Source</a></p><div class="doc"><p>Similar to <code><a href="Data-Edison-Coll.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
   collection 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></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Data-Edison-Coll.html#t:Coll">Coll</a> c a, <a href="Data-Edison-Coll.html#t:OrdCollX">OrdCollX</a> c a) =&gt; <a name="t:OrdColl" class="def">OrdColl</a> c a | c -&gt; a <span class="keyword">where</span> <a href="src/Data-Edison-Coll.html#OrdColl" class="link">Source</a></p><div class="doc"><p>Collections with observable elements where the elements additionally
   have an ordering relation.  See the module documentation for comments
   on observability.</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:minView" class="def">minView</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; c -&gt; m (a, c) <a href="src/Data-Edison-Coll.html#minView" class="link">Source</a></p><div class="doc"><p>Return the minimum element in the collection, together with
   the collection without that element.  If there are multiple
   copies of the minimum element, it is unspecified which is chosen.
   <em>Note</em> that <code><a href="Data-Edison-Coll.html#v:minView">minView</a></code>, <code><a href="Data-Edison-Coll.html#v:minElem">minElem</a></code>, and <code><a href="Data-Edison-Coll.html#v:deleteMin">deleteMin</a></code> may make different
   choices.  Calls <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#v:fail">fail</a></code> if the collection is empty.</p><p>This function is <em>ambiguous</em> at bag types, if more than one minimum
   element exists in the bag.  Otherwise, it is <em>unambiguous</em>.</p></div><p class="src"><a name="v:minElem" class="def">minElem</a> :: c -&gt; a <a href="src/Data-Edison-Coll.html#minElem" class="link">Source</a></p><div class="doc"><p>Return the minimum element in the collection.  If there are multiple
   copies of the minimum element, it is unspecified which is chosen.
   <em>Note</em> that <code><a href="Data-Edison-Coll.html#v:minView">minView</a></code>, <code><a href="Data-Edison-Coll.html#v:minElem">minElem</a></code>, and <code><a href="Data-Edison-Coll.html#v:deleteMin">deleteMin</a></code> may make different
   choices.  Signals an error if the collection is empty.</p><p>This function is <em>ambiguous</em> at bag types, if more than one minimum
   element exists in the bag.  Otherwise, it is <em>unambiguous</em>.</p></div><p class="src"><a name="v:maxView" class="def">maxView</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#t:Monad">Monad</a> m =&gt; c -&gt; m (a, c) <a href="src/Data-Edison-Coll.html#maxView" class="link">Source</a></p><div class="doc"><p>Return the maximum element in the collection, together with 
   the collection without that element.  If there are multiple
   copies of the maximum element, it is unspecified which is chosen.
   <em>Note</em> that <code><a href="Data-Edison-Coll.html#v:maxView">maxView</a></code>, <code><a href="Data-Edison-Coll.html#v:maxElem">maxElem</a></code> and <code><a href="Data-Edison-Coll.html#v:deleteMax">deleteMax</a></code> may make different
   choices.  Calls <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Control-Monad.html#v:fail">fail</a></code> if the collection is empty.</p><p>This function is <em>ambiguous</em> at bag types, if more than one maximum
   element exists in the bag.  Otherwise, it is <em>unambiguous</em>.</p></div><p class="src"><a name="v:maxElem" class="def">maxElem</a> :: c -&gt; a <a href="src/Data-Edison-Coll.html#maxElem" class="link">Source</a></p><div class="doc"><p>Return the maximum element in the collection.  If there are multiple
   copies of the maximum element, it is unspecified which is chosen.
   <em>Note</em> that <code><a href="Data-Edison-Coll.html#v:maxView">maxView</a></code>, <code><a href="Data-Edison-Coll.html#v:maxElem">maxElem</a></code> and <code><a href="Data-Edison-Coll.html#v:deleteMax">deleteMax</a></code> may make different
   choices.  Signals an error if the collection is empty.</p><p>This function is <em>ambiguous</em> at bag types, if more than one maximum
   element exists in the bag.  Otherwise, it is <em>unambiguous</em>.</p></div><p class="src"><a name="v:foldr" class="def">foldr</a> :: (a -&gt; b -&gt; b) -&gt; b -&gt; c -&gt; b <a href="src/Data-Edison-Coll.html#foldr" class="link">Source</a></p><div class="doc"><p>Fold across the elements in non-decreasing order with right
   associativity. (For sets, this will always be increasing order)</p><p>This function is <em>unambiguous</em> if the combining function is
   fold-commutative, at all set types, and at bag types
   where no two equivalent elements exist in the bag.  Otherwise
   it is <em>ambiguous</em>.</p></div><p class="src"><a name="v:foldr-39-" class="def">foldr'</a> :: (a -&gt; b -&gt; b) -&gt; b -&gt; c -&gt; b <a href="src/Data-Edison-Coll.html#foldr%27" class="link">Source</a></p><div class="doc"><p>A strict variant of <code><a href="Data-Edison-Coll.html#v:foldr">foldr</a></code>.</p><p>This function is <em>unambiguous</em> if the combining function is
   fold-commutative, at all set types, and at bag types
   where no two equivalent elements exist in the bag.  Otherwise
   it is <em>ambiguous</em>.</p></div><p class="src"><a name="v:foldl" class="def">foldl</a> :: (b -&gt; a -&gt; b) -&gt; b -&gt; c -&gt; b <a href="src/Data-Edison-Coll.html#foldl" class="link">Source</a></p><div class="doc"><p>Fold across the elements in non-decreasing order with left
   associativity. (For sets, this will always be increasing order)</p><p>This function is <em>unambiguous</em> if the combining function is
   fold-commutative, at all set types, and at bag types
   where no two equivalent elements exist in the bag.  Otherwise
   it is <em>ambiguous</em>.</p></div><p class="src"><a name="v:foldl-39-" class="def">foldl'</a> :: (b -&gt; a -&gt; b) -&gt; b -&gt; c -&gt; b <a href="src/Data-Edison-Coll.html#foldl%27" class="link">Source</a></p><div class="doc"><p>A strict variant of <code><a href="Data-Edison-Coll.html#v:foldl">foldl</a></code>.</p><p>This function is <em>unambiguous</em> if the combining function is
   fold-commutative, at all set types, and at bag types
   where no two equivalent elements exist in the bag.  Otherwise
   it is <em>ambiguous</em>.</p></div><p class="src"><a name="v:foldr1" class="def">foldr1</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; a <a href="src/Data-Edison-Coll.html#foldr1" class="link">Source</a></p><div class="doc"><p>Fold across the elements in non-decreasing order with right
   associativity, or signal an error if the collection is empty.
   (For sets, this will always be increasing order)</p><p>This function is <em>unambiguous</em> if the combining function is
   fold-commutative, at all set types, and at bag types
   where no two equivalent elements exist in the bag.  Otherwise
   it is <em>ambiguous</em>.</p></div><p class="src"><a name="v:foldr1-39-" class="def">foldr1'</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; a <a href="src/Data-Edison-Coll.html#foldr1%27" class="link">Source</a></p><div class="doc"><p>A strict variant of <code><a href="Data-Edison-Coll.html#v:foldr1">foldr1</a></code>.</p><p>This function is <em>unambiguous</em> if the combining function is
   fold-commutative, at all set types, and at bag types
   where no two equivalent elements exist in the bag.  Otherwise
   it is <em>ambiguous</em>.</p></div><p class="src"><a name="v:foldl1" class="def">foldl1</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; a <a href="src/Data-Edison-Coll.html#foldl1" class="link">Source</a></p><div class="doc"><p>Fold across the elements in non-decreasing order with left
   associativity, or signal an error if the collection is empty.
   (For sets, this will always be increasing order)</p><p>This function is <em>unambiguous</em> if the combining function is
   fold-commutative, at all set types, and at bag types
   where no two equivalent elements exist in the bag.  Otherwise
   it is <em>ambiguous</em>.</p></div><p class="src"><a name="v:foldl1-39-" class="def">foldl1'</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; a <a href="src/Data-Edison-Coll.html#foldl1%27" class="link">Source</a></p><div class="doc"><p>A strict variant of <code><a href="Data-Edison-Coll.html#v:foldl1">foldl1</a></code>.</p><p>This function is <em>unambiguous</em> if the combining function is
   fold-commutative, at all set types, and at bag types
   where no two equivalent elements exist in the bag.  Otherwise
   it is <em>ambiguous</em>.</p></div><p class="src"><a name="v:toOrdSeq" class="def">toOrdSeq</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; c -&gt; seq a <a href="src/Data-Edison-Coll.html#toOrdSeq" class="link">Source</a></p><div class="doc"><p>List the elements in non-decreasing order. (For sets, this will always
   be increasing order)</p><p>At set types, this function is <em>unambiguous</em>.  At bag types, it
   is <em>unambiguous</em> if no two equivalent elements exist in the bag;
   otherwise it is <em>ambiguous</em>.</p></div><p class="src"><a name="v:unsafeMapMonotonic" class="def">unsafeMapMonotonic</a> :: (a -&gt; a) -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#unsafeMapMonotonic" class="link">Source</a></p><div class="doc"><p>Map a monotonic function across all elements of a collection.  The 
   function is required to satisfy the following precondition:</p><pre>forall x y. x &lt; y ==&gt; f x &lt; f y</pre><p>This function is <em>unambiguous</em>, under the precondition.</p></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Data-Edison-Coll.html#t:Coll">Coll</a> c a, <a href="Data-Edison-Coll.html#t:SetX">SetX</a> c a) =&gt; <a name="t:Set" class="def">Set</a> c a | c -&gt; a <span class="keyword">where</span> <a href="src/Data-Edison-Coll.html#Set" class="link">Source</a></p><div class="doc"><p>Collections with observable elements where the set property is maintained;
   that is, a set contains at most one element of the equivalence class
   formed by the <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Eq.html#t:Eq">Eq</a></code> instance on the elements.</p><p><em>WARNING: Each of the following &quot;With&quot; functions is unsafe.</em> 
   The passed in combining functions are used to choose which element is kept
   in the case of duplicates. They are required to satisfy the precondition
   that, given two equal elements, they return a third element equal to the
   other two.  Usually, the combining function just returns its first or
   second argument, but it can combine elements in non-trivial ways.</p><p>The combining function should usually be associative.  Where the function
   involves a sequence of elements, the elements will be combined from
   left-to-right, but with an unspecified associativity.</p><p>For example, if <code>x == y == z</code>,
   then <code>fromSeqWith (+) [x,y,z]</code> equals either
     <code>single (x + (y + z))</code>
   or
     <code>single ((x + y) + z)</code></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:fromSeqWith" class="def">fromSeqWith</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; (a -&gt; a -&gt; a) -&gt; seq a -&gt; c <a href="src/Data-Edison-Coll.html#fromSeqWith" class="link">Source</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Coll.html#v:fromSeq">fromSeq</a></code> but with a combining function to resolve duplicates.  </p><p>This function is <em>unambiguous</em> under the &quot;with&quot; precondition
   if the combining function is associative.  Otherwise it is <em>ambiguous</em>.</p></div><p class="src"><a name="v:insertWith" class="def">insertWith</a> :: (a -&gt; a -&gt; a) -&gt; a -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#insertWith" class="link">Source</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Coll.html#v:insert">insert</a></code> but with a combining function to resolve duplicates.</p><p>This function is <em>unambiguous</em> under the &quot;with&quot; precondition.</p></div><p class="src"><a name="v:insertSeqWith" class="def">insertSeqWith</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; (a -&gt; a -&gt; a) -&gt; seq a -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#insertSeqWith" class="link">Source</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Coll.html#v:insertSeq">insertSeq</a></code> but with a combining function to resolve duplicates.</p><p>This function is <em>unambiguous</em> under the &quot;with&quot; precondition
   if the combining function is associative.  Otherwise it is <em>ambiguous</em>.</p></div><p class="src"><a name="v:unionl" class="def">unionl</a> :: c -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#unionl" class="link">Source</a></p><div class="doc"><p>Left biased union.</p><p><em>Axioms:</em></p><ul><li><pre>unionl = unionWith (\x y -&gt; x)</pre></li></ul><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:unionr" class="def">unionr</a> :: c -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#unionr" class="link">Source</a></p><div class="doc"><p>Right biased union.</p><p><em>Axioms:</em></p><ul><li><pre>unionr = unionWith (\x y -&gt; y)</pre></li></ul><p>This function is always <em>unambiguous</em>.</p></div><p class="src"><a name="v:unionWith" class="def">unionWith</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#unionWith" class="link">Source</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Coll.html#v:union">union</a></code>, but with a combining function to resolve duplicates.    </p><p>This function is <em>unambiguous</em> under the &quot;with&quot; precondition.</p></div><p class="src"><a name="v:unionSeqWith" class="def">unionSeqWith</a> :: <a href="Data-Edison-Seq.html#t:Sequence">Sequence</a> seq =&gt; (a -&gt; a -&gt; a) -&gt; seq c -&gt; c <a href="src/Data-Edison-Coll.html#unionSeqWith" class="link">Source</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Coll.html#v:unionSeq">unionSeq</a></code>, but with a combining function to resolve duplicates.</p><p>This function is <em>unambiguous</em> under the &quot;with&quot; precondition
   if the combining function is associative.  Otherwise it is <em>ambiguous</em>.</p></div><p class="src"><a name="v:intersectionWith" class="def">intersectionWith</a> :: (a -&gt; a -&gt; a) -&gt; c -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#intersectionWith" class="link">Source</a></p><div class="doc"><p>Same as <code><a href="Data-Edison-Coll.html#v:intersection">intersection</a></code>, but with a combining function to resolve duplicates.</p><p>This function is <em>unambiguous</em> under the &quot;with&quot; precondition.</p></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Data-Edison-Coll.html#t:OrdColl">OrdColl</a> c a, <a href="Data-Edison-Coll.html#t:Set">Set</a> c a) =&gt; <a name="t:OrdSet" class="def">OrdSet</a> c a | c -&gt; a <a href="src/Data-Edison-Coll.html#OrdSet" class="link">Source</a></p><div class="doc"><p>Collections with observable elements where the set property is maintained
   and where additionally, there is an ordering relation on the elements.
   This class introduces no new methods, and is simply an abbreviation 
   for the context:</p><pre>(OrdColl c a,Set c a)</pre></div></div><h1 id="g:5">Specializations of all the sequence operations to lists</h1><div class="top"><p class="src"><a name="v:fromList" class="def">fromList</a> :: <a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a =&gt; [a] -&gt; c <a href="src/Data-Edison-Coll.html#fromList" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:insertList" class="def">insertList</a> :: <a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a =&gt; [a] -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#insertList" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:unionList" class="def">unionList</a> :: <a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a =&gt; [c] -&gt; c <a href="src/Data-Edison-Coll.html#unionList" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:deleteList" class="def">deleteList</a> :: <a href="Data-Edison-Coll.html#t:CollX">CollX</a> c a =&gt; [a] -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#deleteList" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:unsafeFromOrdList" class="def">unsafeFromOrdList</a> :: <a href="Data-Edison-Coll.html#t:OrdCollX">OrdCollX</a> c a =&gt; [a] -&gt; c <a href="src/Data-Edison-Coll.html#unsafeFromOrdList" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:toList" class="def">toList</a> :: <a href="Data-Edison-Coll.html#t:Coll">Coll</a> c a =&gt; c -&gt; [a] <a href="src/Data-Edison-Coll.html#toList" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:lookupList" class="def">lookupList</a> :: <a href="Data-Edison-Coll.html#t:Coll">Coll</a> c a =&gt; a -&gt; c -&gt; [a] <a href="src/Data-Edison-Coll.html#lookupList" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:toOrdList" class="def">toOrdList</a> :: <a href="Data-Edison-Coll.html#t:OrdColl">OrdColl</a> c a =&gt; c -&gt; [a] <a href="src/Data-Edison-Coll.html#toOrdList" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:fromListWith" class="def">fromListWith</a> :: <a href="Data-Edison-Coll.html#t:Set">Set</a> c a =&gt; (a -&gt; a -&gt; a) -&gt; [a] -&gt; c <a href="src/Data-Edison-Coll.html#fromListWith" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:insertListWith" class="def">insertListWith</a> :: <a href="Data-Edison-Coll.html#t:Set">Set</a> c a =&gt; (a -&gt; a -&gt; a) -&gt; [a] -&gt; c -&gt; c <a href="src/Data-Edison-Coll.html#insertListWith" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:unionListWith" class="def">unionListWith</a> :: <a href="Data-Edison-Coll.html#t:Set">Set</a> c a =&gt; (a -&gt; a -&gt; a) -&gt; [c] -&gt; c <a href="src/Data-Edison-Coll.html#unionListWith" class="link">Source</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.1</p></div></body></html>