/usr/share/doc/libghc-unordered-containers-doc/html/unordered-containers.txt is in libghc-unordered-containers-doc 0.2.3.0-3build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 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 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 | -- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Efficient hashing-based container types
--
-- Efficient hashing-based container types. The containers have been
-- optimized for performance critical use, both in terms of large data
-- quantities and high speed.
--
-- The declared cost of each operation is either worst-case or amortized,
-- but remains valid even if structures are shared.
@package unordered-containers
@version 0.2.3.0
-- | A map from <i>hashable</i> keys to values. A map cannot contain
-- duplicate keys; each key can map to at most one value. A
-- <a>HashMap</a> makes no guarantees as to the order of its elements.
--
-- This map is strict in both the keys and the values; keys and values
-- are evaluated to <i>weak head normal form</i> before they are added to
-- the map. Exception: the provided instances are the same as for the
-- lazy version of this module.
--
-- The implementation is based on <i>hash array mapped tries</i>. A
-- <a>HashMap</a> is often faster than other tree-based set types,
-- especially when key comparison is expensive, as in the case of
-- strings.
--
-- Many operations have a average-case complexity of <i>O(log n)</i>. The
-- implementation uses a large base (i.e. 16) so in practice these
-- operations are constant time.
module Data.HashMap.Strict
-- | A map from keys to values. A map cannot contain duplicate keys; each
-- key can map to at most one value.
data HashMap k v
-- | <i>O(1)</i> Construct an empty map.
empty :: HashMap k v
-- | <i>O(1)</i> Construct a map with a single element.
singleton :: Hashable k => k -> v -> HashMap k v
-- | <i>O(1)</i> Return <a>True</a> if this map is empty, <a>False</a>
-- otherwise.
null :: HashMap k v -> Bool
-- | <i>O(n)</i> Return the number of key-value mappings in this map.
size :: HashMap k v -> Int
-- | <i>O(log n)</i> Return <a>True</a> if the specified key is present in
-- the map, <a>False</a> otherwise.
member :: (Eq k, Hashable k) => k -> HashMap k a -> Bool
-- | <i>O(log n)</i> Return the value to which the specified key is mapped,
-- or <a>Nothing</a> if this map contains no mapping for the key.
lookup :: (Eq k, Hashable k) => k -> HashMap k v -> Maybe v
-- | <i>O(log n)</i> Return the value to which the specified key is mapped,
-- or the default value if this map contains no mapping for the key.
lookupDefault :: (Eq k, Hashable k) => v -> k -> HashMap k v -> v
-- | <i>O(log n)</i> Return the value to which the specified key is mapped.
-- Calls <a>error</a> if this map contains no mapping for the key.
(!) :: (Eq k, Hashable k) => HashMap k v -> k -> v
-- | <i>O(log n)</i> Associate the specified value with the specified key
-- in this map. If this map previously contained a mapping for the key,
-- the old value is replaced.
insert :: (Eq k, Hashable k) => k -> v -> HashMap k v -> HashMap k v
-- | <i>O(log n)</i> Associate the value with the key in this map. If this
-- map previously contained a mapping for the key, the old value is
-- replaced by the result of applying the given function to the new and
-- old value. Example:
--
-- <pre>
-- insertWith f k v map
-- where f new old = new + old
-- </pre>
insertWith :: (Eq k, Hashable k) => (v -> v -> v) -> k -> v -> HashMap k v -> HashMap k v
-- | <i>O(log n)</i> Remove the mapping for the specified key from this map
-- if present.
delete :: (Eq k, Hashable k) => k -> HashMap k v -> HashMap k v
-- | <i>O(log n)</i> Adjust the value tied to a given key in this map only
-- if it is present. Otherwise, leave the map alone.
adjust :: (Eq k, Hashable k) => (v -> v) -> k -> HashMap k v -> HashMap k v
-- | <i>O(n+m)</i> The union of two maps. If a key occurs in both maps, the
-- mapping from the first will be the mapping in the result.
union :: (Eq k, Hashable k) => HashMap k v -> HashMap k v -> HashMap k v
-- | <i>O(n+m)</i> The union of two maps. If a key occurs in both maps, the
-- provided function (first argument) will be used to compute the result.
unionWith :: (Eq k, Hashable k) => (v -> v -> v) -> HashMap k v -> HashMap k v -> HashMap k v
-- | Construct a set containing all elements from a list of sets.
unions :: (Eq k, Hashable k) => [HashMap k v] -> HashMap k v
map :: (v1 -> v2) -> HashMap k v1 -> HashMap k v2
-- | <i>O(n)</i> Transform this map by accumulating an Applicative result
-- from every value.
traverseWithKey :: Applicative f => (k -> v1 -> f v2) -> HashMap k v1 -> f (HashMap k v2)
-- | <i>O(n*log m)</i> Difference of two maps. Return elements of the first
-- map not existing in the second.
difference :: (Eq k, Hashable k) => HashMap k v -> HashMap k w -> HashMap k v
-- | <i>O(n*log m)</i> Intersection of two maps. Return elements of the
-- first map for keys existing in the second.
intersection :: (Eq k, Hashable k) => HashMap k v -> HashMap k w -> HashMap k v
-- | <i>O(n+m)</i> Intersection of two maps. If a key occurs in both maps
-- the provided function is used to combine the values from the two maps.
intersectionWith :: (Eq k, Hashable k) => (v1 -> v2 -> v3) -> HashMap k v1 -> HashMap k v2 -> HashMap k v3
-- | <i>O(n)</i> Reduce this map by applying a binary operator to all
-- elements, using the given starting value (typically the left-identity
-- of the operator). Each application of the operator is evaluated before
-- before using the result in the next application. This function is
-- strict in the starting value.
foldl' :: (a -> v -> a) -> a -> HashMap k v -> a
-- | <i>O(n)</i> Reduce this map by applying a binary operator to all
-- elements, using the given starting value (typically the left-identity
-- of the operator). Each application of the operator is evaluated before
-- before using the result in the next application. This function is
-- strict in the starting value.
foldlWithKey' :: (a -> k -> v -> a) -> a -> HashMap k v -> a
-- | <i>O(n)</i> Reduce this map by applying a binary operator to all
-- elements, using the given starting value (typically the right-identity
-- of the operator).
foldr :: (v -> a -> a) -> a -> HashMap k v -> a
-- | <i>O(n)</i> Reduce this map by applying a binary operator to all
-- elements, using the given starting value (typically the right-identity
-- of the operator).
foldrWithKey :: (k -> v -> a -> a) -> a -> HashMap k v -> a
-- | <i>O(n)</i> Filter this map by retaining only elements which values
-- satisfy a predicate.
filter :: (v -> Bool) -> HashMap k v -> HashMap k v
-- | <i>O(n)</i> Filter this map by retaining only elements satisfying a
-- predicate.
filterWithKey :: (k -> v -> Bool) -> HashMap k v -> HashMap k v
-- | <i>O(n)</i> Return a list of this map's keys. The list is produced
-- lazily.
keys :: HashMap k v -> [k]
-- | <i>O(n)</i> Return a list of this map's values. The list is produced
-- lazily.
elems :: HashMap k v -> [v]
-- | <i>O(n)</i> Return a list of this map's elements. The list is produced
-- lazily.
toList :: HashMap k v -> [(k, v)]
-- | <i>O(n*log n)</i> Construct a map with the supplied mappings. If the
-- list contains duplicate mappings, the later mappings take precedence.
fromList :: (Eq k, Hashable k) => [(k, v)] -> HashMap k v
-- | <i>O(n*log n)</i> Construct a map from a list of elements. Uses the
-- provided function to merge duplicate entries.
fromListWith :: (Eq k, Hashable k) => (v -> v -> v) -> [(k, v)] -> HashMap k v
-- | A map from <i>hashable</i> keys to values. A map cannot contain
-- duplicate keys; each key can map to at most one value. A
-- <a>HashMap</a> makes no guarantees as to the order of its elements.
--
-- This map is strict in the keys and lazy in the values; keys are
-- evaluated to <i>weak head normal form</i> before they are added to the
-- map.
--
-- The implementation is based on <i>hash array mapped tries</i>. A
-- <a>HashMap</a> is often faster than other tree-based set types,
-- especially when key comparison is expensive, as in the case of
-- strings.
--
-- Many operations have a average-case complexity of <i>O(log n)</i>. The
-- implementation uses a large base (i.e. 16) so in practice these
-- operations are constant time.
module Data.HashMap.Lazy
-- | A map from keys to values. A map cannot contain duplicate keys; each
-- key can map to at most one value.
data HashMap k v
-- | <i>O(1)</i> Construct an empty map.
empty :: HashMap k v
-- | <i>O(1)</i> Construct a map with a single element.
singleton :: Hashable k => k -> v -> HashMap k v
-- | <i>O(1)</i> Return <a>True</a> if this map is empty, <a>False</a>
-- otherwise.
null :: HashMap k v -> Bool
-- | <i>O(n)</i> Return the number of key-value mappings in this map.
size :: HashMap k v -> Int
-- | <i>O(log n)</i> Return <a>True</a> if the specified key is present in
-- the map, <a>False</a> otherwise.
member :: (Eq k, Hashable k) => k -> HashMap k a -> Bool
-- | <i>O(log n)</i> Return the value to which the specified key is mapped,
-- or <a>Nothing</a> if this map contains no mapping for the key.
lookup :: (Eq k, Hashable k) => k -> HashMap k v -> Maybe v
-- | <i>O(log n)</i> Return the value to which the specified key is mapped,
-- or the default value if this map contains no mapping for the key.
lookupDefault :: (Eq k, Hashable k) => v -> k -> HashMap k v -> v
-- | <i>O(log n)</i> Return the value to which the specified key is mapped.
-- Calls <a>error</a> if this map contains no mapping for the key.
(!) :: (Eq k, Hashable k) => HashMap k v -> k -> v
-- | <i>O(log n)</i> Associate the specified value with the specified key
-- in this map. If this map previously contained a mapping for the key,
-- the old value is replaced.
insert :: (Eq k, Hashable k) => k -> v -> HashMap k v -> HashMap k v
-- | <i>O(log n)</i> Associate the value with the key in this map. If this
-- map previously contained a mapping for the key, the old value is
-- replaced by the result of applying the given function to the new and
-- old value. Example:
--
-- <pre>
-- insertWith f k v map
-- where f new old = new + old
-- </pre>
insertWith :: (Eq k, Hashable k) => (v -> v -> v) -> k -> v -> HashMap k v -> HashMap k v
-- | <i>O(log n)</i> Remove the mapping for the specified key from this map
-- if present.
delete :: (Eq k, Hashable k) => k -> HashMap k v -> HashMap k v
-- | <i>O(log n)</i> Adjust the value tied to a given key in this map only
-- if it is present. Otherwise, leave the map alone.
adjust :: (Eq k, Hashable k) => (v -> v) -> k -> HashMap k v -> HashMap k v
-- | <i>O(n+m)</i> The union of two maps. If a key occurs in both maps, the
-- mapping from the first will be the mapping in the result.
union :: (Eq k, Hashable k) => HashMap k v -> HashMap k v -> HashMap k v
-- | <i>O(n+m)</i> The union of two maps. If a key occurs in both maps, the
-- provided function (first argument) will be used to compute the result.
unionWith :: (Eq k, Hashable k) => (v -> v -> v) -> HashMap k v -> HashMap k v -> HashMap k v
-- | Construct a set containing all elements from a list of sets.
unions :: (Eq k, Hashable k) => [HashMap k v] -> HashMap k v
map :: (v1 -> v2) -> HashMap k v1 -> HashMap k v2
-- | <i>O(n)</i> Transform this map by accumulating an Applicative result
-- from every value.
traverseWithKey :: Applicative f => (k -> v1 -> f v2) -> HashMap k v1 -> f (HashMap k v2)
-- | <i>O(n*log m)</i> Difference of two maps. Return elements of the first
-- map not existing in the second.
difference :: (Eq k, Hashable k) => HashMap k v -> HashMap k w -> HashMap k v
-- | <i>O(n*log m)</i> Intersection of two maps. Return elements of the
-- first map for keys existing in the second.
intersection :: (Eq k, Hashable k) => HashMap k v -> HashMap k w -> HashMap k v
-- | <i>O(n+m)</i> Intersection of two maps. If a key occurs in both maps
-- the provided function is used to combine the values from the two maps.
intersectionWith :: (Eq k, Hashable k) => (v1 -> v2 -> v3) -> HashMap k v1 -> HashMap k v2 -> HashMap k v3
-- | <i>O(n)</i> Reduce this map by applying a binary operator to all
-- elements, using the given starting value (typically the left-identity
-- of the operator). Each application of the operator is evaluated before
-- before using the result in the next application. This function is
-- strict in the starting value.
foldl' :: (a -> v -> a) -> a -> HashMap k v -> a
-- | <i>O(n)</i> Reduce this map by applying a binary operator to all
-- elements, using the given starting value (typically the left-identity
-- of the operator). Each application of the operator is evaluated before
-- before using the result in the next application. This function is
-- strict in the starting value.
foldlWithKey' :: (a -> k -> v -> a) -> a -> HashMap k v -> a
-- | <i>O(n)</i> Reduce this map by applying a binary operator to all
-- elements, using the given starting value (typically the right-identity
-- of the operator).
foldr :: (v -> a -> a) -> a -> HashMap k v -> a
-- | <i>O(n)</i> Reduce this map by applying a binary operator to all
-- elements, using the given starting value (typically the right-identity
-- of the operator).
foldrWithKey :: (k -> v -> a -> a) -> a -> HashMap k v -> a
-- | <i>O(n)</i> Filter this map by retaining only elements which values
-- satisfy a predicate.
filter :: (v -> Bool) -> HashMap k v -> HashMap k v
-- | <i>O(n)</i> Filter this map by retaining only elements satisfying a
-- predicate.
filterWithKey :: (k -> v -> Bool) -> HashMap k v -> HashMap k v
-- | <i>O(n)</i> Return a list of this map's keys. The list is produced
-- lazily.
keys :: HashMap k v -> [k]
-- | <i>O(n)</i> Return a list of this map's values. The list is produced
-- lazily.
elems :: HashMap k v -> [v]
-- | <i>O(n)</i> Return a list of this map's elements. The list is produced
-- lazily.
toList :: HashMap k v -> [(k, v)]
-- | <i>O(n)</i> Construct a map with the supplied mappings. If the list
-- contains duplicate mappings, the later mappings take precedence.
fromList :: (Eq k, Hashable k) => [(k, v)] -> HashMap k v
-- | <i>O(n*log n)</i> Construct a map from a list of elements. Uses the
-- provided function to merge duplicate entries.
fromListWith :: (Eq k, Hashable k) => (v -> v -> v) -> [(k, v)] -> HashMap k v
-- | A set of <i>hashable</i> values. A set cannot contain duplicate items.
-- A <a>HashSet</a> makes no guarantees as to the order of its elements.
--
-- The implementation is based on <i>hash array mapped trie</i>. A
-- <a>HashSet</a> is often faster than other tree-based set types,
-- especially when value comparison is expensive, as in the case of
-- strings.
--
-- Many operations have a average-case complexity of <i>O(log n)</i>. The
-- implementation uses a large base (i.e. 16) so in practice these
-- operations are constant time.
module Data.HashSet
-- | A set of values. A set cannot contain duplicate values.
data HashSet a
-- | <i>O(1)</i> Construct an empty set.
empty :: HashSet a
-- | <i>O(1)</i> Construct a set with a single element.
singleton :: Hashable a => a -> HashSet a
-- | <i>O(n+m)</i> Construct a set containing all elements from both sets.
--
-- To obtain good performance, the smaller set must be presented as the
-- first argument.
union :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
-- | Construct a set containing all elements from a list of sets.
unions :: (Eq a, Hashable a) => [HashSet a] -> HashSet a
-- | <i>O(1)</i> Return <a>True</a> if this set is empty, <a>False</a>
-- otherwise.
null :: HashSet a -> Bool
-- | <i>O(n)</i> Return the number of elements in this set.
size :: HashSet a -> Int
-- | <i>O(min(n,W))</i> Return <a>True</a> if the given value is present in
-- this set, <a>False</a> otherwise.
member :: (Eq a, Hashable a) => a -> HashSet a -> Bool
-- | <i>O(min(n,W))</i> Add the specified value to this set.
insert :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
-- | <i>O(min(n,W))</i> Remove the specified value from this set if
-- present.
delete :: (Eq a, Hashable a) => a -> HashSet a -> HashSet a
-- | <i>O(n)</i> Transform this set by applying a function to every value.
-- The resulting set may be smaller than the source.
map :: (Hashable b, Eq b) => (a -> b) -> HashSet a -> HashSet b
-- | <i>O(n)</i> Difference of two sets. Return elements of the first set
-- not existing in the second.
difference :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
-- | <i>O(n)</i> Intersection of two sets. Return elements present in both
-- the first set and the second.
intersection :: (Eq a, Hashable a) => HashSet a -> HashSet a -> HashSet a
-- | <i>O(n)</i> Reduce this set by applying a binary operator to all
-- elements, using the given starting value (typically the left-identity
-- of the operator). Each application of the operator is evaluated before
-- before using the result in the next application. This function is
-- strict in the starting value.
foldl' :: (a -> b -> a) -> a -> HashSet b -> a
-- | <i>O(n)</i> Reduce this set by applying a binary operator to all
-- elements, using the given starting value (typically the right-identity
-- of the operator).
foldr :: (b -> a -> a) -> a -> HashSet b -> a
-- | <i>O(n)</i> Filter this set by retaining only elements satisfying a
-- predicate.
filter :: (a -> Bool) -> HashSet a -> HashSet a
-- | <i>O(n)</i> Return a list of this set's elements. The list is produced
-- lazily.
toList :: HashSet a -> [a]
-- | <i>O(n*min(W, n))</i> Construct a set from a list of elements.
fromList :: (Eq a, Hashable a) => [a] -> HashSet a
instance Typeable1 HashSet
instance (Data a, Eq a, Hashable a) => Data (HashSet a)
instance Show a => Show (HashSet a)
instance (Hashable a, Eq a) => Monoid (HashSet a)
instance Foldable HashSet
instance (Hashable a, Eq a) => Eq (HashSet a)
instance NFData a => NFData (HashSet a)
|