map :: (Char -> Char) -> ByteString -> ByteString

bytestring -Data.ByteString.Lazy.Char8  

<p><em>O(n)</em> <code><a href="/?query=%28%28name%3A%28%21map%29%20package%3A%28%21bytestring%29%20module%3A%28%21Data.ByteString.Lazy.Char8%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21map%29%20package%3A%28%21bytestring%29%29%5E10.0%29%20OR%20name%3A%28%21map%29">map</a></code> <code>f xs</code> is the ByteString obtained by applying <code>f</code> to each element of <code>xs</code></p>
map :: (Word8 -> Word8) -> ByteString -> ByteString

bytestring -Data.ByteString.Lazy  

<p><em>O(n)</em> <code><a href="/?query=%28%28name%3A%28%21map%29%20package%3A%28%21bytestring%29%20module%3A%28%21Data.ByteString.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21map%29%20package%3A%28%21bytestring%29%29%5E10.0%29%20OR%20name%3A%28%21map%29">map</a></code> <code>f xs</code> is the ByteString obtained by applying <code>f</code> to each element of <code>xs</code>.</p>
map :: (a -> b) -> IntMap a -> IntMap b

containers -Data.IntMap.Lazy  

<p><em>O(n)</em>. Map a function over all values in the map.</p><pre>map (++ "x") (fromList [(5,"a"), (3,"b")]) == fromList [(3, "bx"), (5, "ax")]</pre>
map :: (a -> b) -> Map k a -> Map k b

containers -Data.Map.Lazy  

<p><em>O(n)</em>. Map a function over all values in the map.</p><pre>map (++ "x") (fromList [(5,"a"), (3,"b")]) == fromList [(3, "bx"), (5, "ax")]</pre>
map :: (Char -> Char) -> Text -> Text

text -Data.Text.Lazy  

<p><em>O(n)</em> <code><a href="/?query=%28%28name%3A%28%21map%29%20package%3A%28%21text%29%20module%3A%28%21Data.Text.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21map%29%20package%3A%28%21text%29%29%5E10.0%29%20OR%20name%3A%28%21map%29">map</a></code> <code>f</code> <code>t</code> is the <code><a href="/?query=%28%28name%3A%28%21Text%29%20package%3A%28%21text%29%20module%3A%28%21Data.Text.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Text%29%20package%3A%28%21text%29%29%5E10.0%29%20OR%20name%3A%28%21Text%29">Text</a></code> obtained by applying <code>f</code> to each element of <code>t</code>. Subject to fusion. Performs replacement on invalid scalar values.</p>
map :: (v1 -> v2) -> HashMap k v1 -> HashMap k v2

unordered-containers -Data.HashMap.Lazy  

<p><em>O(n)</em> Transform this map by applying a function to every value.</p>

containers -Data.Map.Lazy  

<p>A Map from keys <code>k</code> to values <code>a</code>.</p>

containers -Data.Map.Lazy  

<div class="doc"><p>An efficient implementation of ordered maps from keys to values (dictionaries).</p><p>API of this module is strict in the keys, but lazy in the values. If you need value-strict maps, use <a href="/?query=%28%28name%3A%28%21Data.Map.Strict%29%20package%3A%28%21containers%29%20module%3A%28%21Data.Map.Strict%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Data.Map.Strict%29%20package%3A%28%21containers%29%29%5E10.0%29%20OR%20name%3A%28%21Data.Map.Strict%29">Data.Map.Strict</a> instead. The <code><a href="/?query=%28%28name%3A%28%21Map%29%20package%3A%28%21containers%29%20module%3A%28%21Data.Map.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Map%29%20package%3A%28%21containers%29%29%5E10.0%29%20OR%20name%3A%28%21Map%29">Map</a></code> type itself is shared between the lazy and strict modules, meaning that the same <code><a href="/?query=%28%28name%3A%28%21Map%29%20package%3A%28%21containers%29%20module%3A%28%21Data.Map.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Map%29%20package%3A%28%21containers%29%29%5E10.0%29%20OR%20name%3A%28%21Map%29">Map</a></code> value can be passed to functions in both modules (although that is rarely needed).</p><p>These modules are intended to be imported qualified, to avoid name clashes with Prelude functions, e.g.</p><pre> import qualified Data.Map.Lazy as Map</pre><p>The implementation of <code><a href="/?query=%28%28name%3A%28%21Map%29%20package%3A%28%21containers%29%20module%3A%28%21Data.Map.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21Map%29%20package%3A%28%21containers%29%29%5E10.0%29%20OR%20name%3A%28%21Map%29">Map</a></code> is based on <em>size balanced</em> binary trees (or trees of <em>bounded balance</em>) as described by:</p><ul><li>Stephen Adams, "<em>Efficient sets: a balancing act</em>", Journal of Functional Programming 3(4):553-562, October 1993, <a href="http://www.swiss.ai.mit.edu/~adams/BB/">http://www.swiss.ai.mit.edu/~adams/BB/</a>.<ul><li>J. Nievergelt and E.M. Reingold, "<em>Binary search trees of bounded balance</em>", SIAM journal of computing 2(1), March 1973.</li></ul></li></ul><p>Note that the implementation is <em>left-biased</em> -- the elements of a first argument are always preferred to the second, for example in <code><a href="/?query=%28%28name%3A%28%21union%29%20package%3A%28%21containers%29%20module%3A%28%21Data.Map.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21union%29%20package%3A%28%21containers%29%29%5E10.0%29%20OR%20name%3A%28%21union%29">union</a></code> or <code><a href="/?query=%28%28name%3A%28%21insert%29%20package%3A%28%21containers%29%20module%3A%28%21Data.Map.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21insert%29%20package%3A%28%21containers%29%29%5E10.0%29%20OR%20name%3A%28%21insert%29">insert</a></code>.</p><p><em>Warning</em>: The size of the map must not exceed <code>maxBound::Int</code>. Violation of this condition is not detected and if the size limit is exceeded, its behaviour is undefined.</p><p>Operation comments contain the operation time complexity in the Big-O notation (<a href="http://en.wikipedia.org/wiki/Big_O_notation">http://en.wikipedia.org/wiki/Big_O_notation</a>).</p></div>
showTreeWith :: (k -> a -> String) -> Bool -> Bool -> Map k a -> String

containers -Data.Map.Lazy  

<p><em>O(n)</em>. The expression (<code><code><a href="/?query=%28%28name%3A%28%21showTreeWith%29%20package%3A%28%21containers%29%20module%3A%28%21Data.Map.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21showTreeWith%29%20package%3A%28%21containers%29%29%5E10.0%29%20OR%20name%3A%28%21showTreeWith%29">showTreeWith</a></code> showelem hang wide map</code>) shows the tree that implements the map. Elements are shown using the <code>showElem</code> function. If <code>hang</code> is <code><a href="/?query=%28%28name%3A%28%21True%29%20package%3A%28%21base%29%20module%3A%28%21Data.Bool%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21True%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21True%29">True</a></code>, a <em>hanging</em> tree is shown otherwise a rotated tree is shown. If <code>wide</code> is <code><a href="/?query=%28%28name%3A%28%21True%29%20package%3A%28%21base%29%20module%3A%28%21Data.Bool%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21True%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21True%29">True</a></code>, an extra wide version is shown.</p><pre> Map> let t = fromDistinctAscList [(x,()) | x <- [1..5]] Map> putStrLn $ showTreeWith (\k x -> show (k,x)) True False t (4,()) +--(2,()) | +--(1,()) | +--(3,()) +--(5,()) Map> putStrLn $ showTreeWith (\k x -> show (k,x)) True True t (4,()) | +--(2,()) | | | +--(1,()) | | | +--(3,()) | +--(5,()) Map> putStrLn $ showTreeWith (\k x -> show (k,x)) False True t +--(5,()) | (4,()) | | +--(3,()) | | +--(2,()) | +--(1,())</pre>
foldlWithKey :: (a -> Key -> b -> a) -> a -> IntMap b -> a

containers -Data.IntMap.Lazy  

<p><em>O(n)</em>. Fold the keys and values in the map using the given left-associative binary operator, such that <code><code><a href="/?query=%28%28name%3A%28%21foldlWithKey%29%20package%3A%28%21containers%29%20module%3A%28%21Data.IntMap.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21foldlWithKey%29%20package%3A%28%21containers%29%29%5E10.0%29%20OR%20name%3A%28%21foldlWithKey%29">foldlWithKey</a></code> f z == <code><a href="/?query=%28%28name%3A%28%21foldl%29%20package%3A%28%21base%29%20module%3A%28%21Prelude%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21foldl%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21foldl%29">foldl</a></code> (\z' (kx, x) -> f z' kx x) z . <code><a href="/?query=%28%28name%3A%28%21toAscList%29%20package%3A%28%21containers%29%20module%3A%28%21Data.IntMap.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21toAscList%29%20package%3A%28%21containers%29%29%5E10.0%29%20OR%20name%3A%28%21toAscList%29">toAscList</a></code></code>.</p><p>For example,</p><pre>keys = reverse . foldlWithKey (\ks k x -> k:ks) []</pre><pre>let f result k a = result ++ "(" ++ (show k) ++ ":" ++ a ++ ")" foldlWithKey f "Map: " (fromList [(5,"a"), (3,"b")]) == "Map: (3:b)(5:a)"</pre>
foldrWithKey :: (Key -> a -> b -> b) -> b -> IntMap a -> b

containers -Data.IntMap.Lazy  

<p><em>O(n)</em>. Fold the keys and values in the map using the given right-associative binary operator, such that <code><code><a href="/?query=%28%28name%3A%28%21foldrWithKey%29%20package%3A%28%21containers%29%20module%3A%28%21Data.IntMap.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21foldrWithKey%29%20package%3A%28%21containers%29%29%5E10.0%29%20OR%20name%3A%28%21foldrWithKey%29">foldrWithKey</a></code> f z == <code><a href="/?query=%28%28name%3A%28%21foldr%29%20package%3A%28%21base%29%20module%3A%28%21Prelude%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21foldr%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21foldr%29">foldr</a></code> (<code><a href="/?query=%28%28name%3A%28%21uncurry%29%20package%3A%28%21base%29%20module%3A%28%21Data.Tuple%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21uncurry%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21uncurry%29">uncurry</a></code> f) z . <code><a href="/?query=%28%28name%3A%28%21toAscList%29%20package%3A%28%21containers%29%20module%3A%28%21Data.IntMap.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21toAscList%29%20package%3A%28%21containers%29%29%5E10.0%29%20OR%20name%3A%28%21toAscList%29">toAscList</a></code></code>.</p><p>For example,</p><pre>keys map = foldrWithKey (\k x ks -> k:ks) [] map</pre><pre>let f k a result = result ++ "(" ++ (show k) ++ ":" ++ a ++ ")" foldrWithKey f "Map: " (fromList [(5,"a"), (3,"b")]) == "Map: (5:a)(3:b)"</pre>
foldlWithKey :: (a -> k -> b -> a) -> a -> Map k b -> a

containers -Data.Map.Lazy  

<p><em>O(n)</em>. Fold the keys and values in the map using the given left-associative binary operator, such that <code><code><a href="/?query=%28%28name%3A%28%21foldlWithKey%29%20package%3A%28%21containers%29%20module%3A%28%21Data.Map.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21foldlWithKey%29%20package%3A%28%21containers%29%29%5E10.0%29%20OR%20name%3A%28%21foldlWithKey%29">foldlWithKey</a></code> f z == <code><a href="/?query=%28%28name%3A%28%21foldl%29%20package%3A%28%21base%29%20module%3A%28%21Prelude%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21foldl%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21foldl%29">foldl</a></code> (\z' (kx, x) -> f z' kx x) z . <code><a href="/?query=%28%28name%3A%28%21toAscList%29%20package%3A%28%21containers%29%20module%3A%28%21Data.Map.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21toAscList%29%20package%3A%28%21containers%29%29%5E10.0%29%20OR%20name%3A%28%21toAscList%29">toAscList</a></code></code>.</p><p>For example,</p><pre>keys = reverse . foldlWithKey (\ks k x -> k:ks) []</pre><pre>let f result k a = result ++ "(" ++ (show k) ++ ":" ++ a ++ ")" foldlWithKey f "Map: " (fromList [(5,"a"), (3,"b")]) == "Map: (3:b)(5:a)"</pre>
foldrWithKey :: (k -> a -> b -> b) -> b -> Map k a -> b

containers -Data.Map.Lazy  

<p><em>O(n)</em>. Fold the keys and values in the map using the given right-associative binary operator, such that <code><code><a href="/?query=%28%28name%3A%28%21foldrWithKey%29%20package%3A%28%21containers%29%20module%3A%28%21Data.Map.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21foldrWithKey%29%20package%3A%28%21containers%29%29%5E10.0%29%20OR%20name%3A%28%21foldrWithKey%29">foldrWithKey</a></code> f z == <code><a href="/?query=%28%28name%3A%28%21foldr%29%20package%3A%28%21base%29%20module%3A%28%21Prelude%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21foldr%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21foldr%29">foldr</a></code> (<code><a href="/?query=%28%28name%3A%28%21uncurry%29%20package%3A%28%21base%29%20module%3A%28%21Data.Tuple%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21uncurry%29%20package%3A%28%21base%29%29%5E10.0%29%20OR%20name%3A%28%21uncurry%29">uncurry</a></code> f) z . <code><a href="/?query=%28%28name%3A%28%21toAscList%29%20package%3A%28%21containers%29%20module%3A%28%21Data.Map.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21toAscList%29%20package%3A%28%21containers%29%29%5E10.0%29%20OR%20name%3A%28%21toAscList%29">toAscList</a></code></code>.</p><p>For example,</p><pre>keys map = foldrWithKey (\k x ks -> k:ks) [] map</pre><pre>let f k a result = result ++ "(" ++ (show k) ++ ":" ++ a ++ ")" foldrWithKey f "Map: " (fromList [(5,"a"), (3,"b")]) == "Map: (5:a)(3:b)"</pre>

containers -Data.Map.Lazy  Data.Map.Strict  

<p><em>O(1)</em>. Is the map empty?</p><pre>Data.Map.null (empty) == True Data.Map.null (singleton 1 'a') == False</pre>
map :: (a -> b) -> IntervalMap k a -> IntervalMap k b

IntervalMap -Data.IntervalMap.Generic.Lazy  Data.IntervalMap.Lazy  

<p><em>O(n)</em>. Map a function over all values in the map. </p>
concatMap :: (Char -> ByteString) -> ByteString -> ByteString

bytestring -Data.ByteString.Lazy.Char8  

<p>Map a function over a <code><a href="/?query=%28%28name%3A%28%21ByteString%29%20package%3A%28%21bytestring%29%20module%3A%28%21Data.ByteString.Lazy.Char8%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21ByteString%29%20package%3A%28%21bytestring%29%29%5E10.0%29%20OR%20name%3A%28%21ByteString%29">ByteString</a></code> and concatenate the results</p>
concatMap :: (Word8 -> ByteString) -> ByteString -> ByteString

bytestring -Data.ByteString.Lazy  

<p>Map a function over a <code><a href="/?query=%28%28name%3A%28%21ByteString%29%20package%3A%28%21bytestring%29%20module%3A%28%21Data.ByteString.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21ByteString%29%20package%3A%28%21bytestring%29%29%5E10.0%29%20OR%20name%3A%28%21ByteString%29">ByteString</a></code> and concatenate the results</p>
mapRWS :: ((a, s, w) -> (b, s, w')) -> RWS r w s a -> RWS r w' s b

transformers -Control.Monad.Trans.RWS.Lazy  

<p>Map the return value, final state and output of a computation using the given function.</p><ul><li><pre><code><a href="/?query=%28%28name%3A%28%21runRWS%29%20package%3A%28%21transformers%29%20module%3A%28%21Control.Monad.Trans.RWS.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21runRWS%29%20package%3A%28%21transformers%29%29%5E10.0%29%20OR%20name%3A%28%21runRWS%29">runRWS</a></code> (<code><a href="/?query=%28%28name%3A%28%21mapRWS%29%20package%3A%28%21transformers%29%20module%3A%28%21Control.Monad.Trans.RWS.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21mapRWS%29%20package%3A%28%21transformers%29%29%5E10.0%29%20OR%20name%3A%28%21mapRWS%29">mapRWS</a></code> f m) r s = f (<code><a href="/?query=%28%28name%3A%28%21runRWS%29%20package%3A%28%21transformers%29%20module%3A%28%21Control.Monad.Trans.RWS.Lazy%29%29%5E100.0%29%20OR%20%28%28name%3A%28%21runRWS%29%20package%3A%28%21transformers%29%29%5E10.0%29%20OR%20name%3A%28%21runRWS%29">runRWS</a></code> m r s)</pre></li></ul>