Help | Examples | About | API | Blog | Hackage | Haskell
Concurrently search more than 6250 packages and more than 585655 functions! (Index generated: Tue, 25 Mar 2014 16:41:17 UTC )
Found 304 functions, 0 packages and 61 completions.
Data.Map.fold:: (a -> b -> b) -> b -> Map k a -> b
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.

Source
Data.Map.Map:: module
containers

Note: You should use Data.Map.Strict instead of this module if:

  • You will eventually need all the values stored.
  • The stored values don't represent large virtual data structures to be lazily computed.

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

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:: (a -> b) -> Map k a -> Map k b
containers

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

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

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

 map (++ "x") (fromList [(5,"a"), (3,"b")]) == fromList [(3, "bx"), (5, "ax")]
Source
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.foldMapWithKey:: (k -> a -> m) -> Map k a -> m
containers

O(n). Fold the keys and values in the map using the given monoid, such that

foldMapWithKey f = fold . mapWithKey f

This can be an asymptotically faster than foldrWithKey or foldlWithKey for some monoids.

Source
Data.Map.Lazy.foldMapWithKey:: (k -> a -> m) -> Map k a -> m
containers

O(n). Fold the keys and values in the map using the given monoid, such that

foldMapWithKey f = fold . mapWithKey f

This can be an asymptotically faster than foldrWithKey or foldlWithKey for some monoids.

Source
Data.Map.Strict.foldl:: (a -> b -> a) -> a -> Map k b -> a
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
Source
Data.Map.Strict.foldr:: (a -> b -> b) -> b -> Map k a -> b
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
Source
Powered by Haskell, HXT, Snap, and
Please send any feedback to hayoo@holumbus.org