Help | Examples | About | API | Blog | Hackage | Haskell
Concurrently search more than 4911 packages and more than 442752 functions! (Index generated: Mon, 22 Apr 2013 08:31:44 UTC )
Found 293 functions, 0 packages and 53 completions.
Data.Map.fold:: fold
containers

Deprecated. As of version 0.5, replaced by foldr.

O(n). Fold the values in the map using the given right-associative binary operator. This function is an equivalent of foldr and is present for compatibility only.

Data.Map.Map:: module
containers

An efficient implementation of ordered maps from keys to values (dictionaries).

This module re-exports the value lazy Data.Map.Lazy API, plus several deprecated value strict functions. Please note that these functions have different strictness properties than those in Data.Map.Strict: they only evaluate the values inserted into the map. For example, the default value to insertWith' is only evaluated if it's used, i.e. because there's no value for the key already or because the higher-order argument that combines the old and new value uses it.

These modules are intended to be imported qualified, to avoid name clashes with Prelude functions, e.g.

  import qualified Data.Map as Map

The implementation of Map is based on size balanced binary trees (or trees of bounded balance) as described by:

  • Stephen Adams, "Efficient sets: a balancing act", Journal of Functional Programming 3(4):553-562, October 1993, http://www.swiss.ai.mit.edu/~adams/BB/.
  • J. Nievergelt and E.M. Reingold, "Binary search trees of bounded balance", SIAM journal of computing 2(1), March 1973.

Note that the implementation is left-biased -- the elements of a first argument are always preferred to the second, for example in union or insert.

Operation comments contain the operation time complexity in the Big-O notation (http://en.wikipedia.org/wiki/Big_O_notation).

Source
Data.Map.Strict.map:: map
containers

O(n). Map a function over all values in the map.

 map (++ "x") (fromList [(5,"a"), (3,"b")]) == fromList [(3, "bx"), (5, "ax")]
Data.Map.Lazy.map:: map
containers

O(n). Map a function over all values in the map.

 map (++ "x") (fromList [(5,"a"), (3,"b")]) == fromList [(3, "bx"), (5, "ax")]
Data.Map.Strict.Map:: data
containers

A Map from keys k to values a.

Source
Data.Map.Lazy.Map:: data
containers

A Map from keys k to values a.

Source
Data.Map.Strict.foldl:: foldl
containers

O(n). Fold the values in the map using the given left-associative binary operator, such that foldl f z == foldl f z . elems.

For example,

 elems = reverse . foldl (flip (:)) []
 let f len a = len + (length a)
 foldl f 0 (fromList [(5,"a"), (3,"bbb")]) == 4
Data.Map.Strict.foldr:: foldr
containers

O(n). Fold the values in the map using the given right-associative binary operator, such that foldr f z == foldr f z . elems.

For example,

 elems map = foldr (:) [] map
 let f a len = len + (length a)
 foldr f 0 (fromList [(5,"a"), (3,"bbb")]) == 4
Data.Map.Lazy.foldl:: foldl
containers

O(n). Fold the values in the map using the given left-associative binary operator, such that foldl f z == foldl f z . elems.

For example,

 elems = reverse . foldl (flip (:)) []
 let f len a = len + (length a)
 foldl f 0 (fromList [(5,"a"), (3,"bbb")]) == 4
Data.Map.Lazy.foldr:: foldr
containers

O(n). Fold the values in the map using the given right-associative binary operator, such that foldr f z == foldr f z . elems.

For example,

 elems map = foldr (:) [] map
 let f a len = len + (length a)
 foldr f 0 (fromList [(5,"a"), (3,"bbb")]) == 4
Powered by Haskell, HXT, Snap, and
Please send any feedback to hayoo@holumbus.org