15 lines
9.4 KiB
HTML
15 lines
9.4 KiB
HTML
<!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.Map.Utils</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-Map-Utils.html");};
|
|
//]]>
|
|
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">MissingH-1.3.0.1: Large utility library</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>Copyright (C) 2004-2011 John Goerzen</td></tr><tr><th>License</th><td>BSD3</td></tr><tr><th>Maintainer</th><td>John Goerzen <jgoerzen@complete.org> </td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Portability</th><td>portable</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Data.Map.Utils</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Basic Utilities</a></li><li><a href="#g:2">Conversions</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This module provides various helpful utilities for dealing with Data.Maps.</p><p>Written by John Goerzen, jgoerzen@complete.org</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:flipM">flipM</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Ord.html#t:Ord">Ord</a> key, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Ord.html#t:Ord">Ord</a> val) => <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> key val -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> val [key]</li><li class="src short"><a href="#v:flippedLookupM">flippedLookupM</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Ord.html#t:Ord">Ord</a> val, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Ord.html#t:Ord">Ord</a> key) => val -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> key val -> [key]</li><li class="src short"><a href="#v:forceLookupM">forceLookupM</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> key, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Ord.html#t:Ord">Ord</a> key) => <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a> -> key -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> key elt -> elt</li><li class="src short"><a href="#v:strToM">strToM</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Read.html#t:Read">Read</a> a, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Read.html#t:Read">Read</a> b, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Ord.html#t:Ord">Ord</a> a) => <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> a b</li><li class="src short"><a href="#v:strFromM">strFromM</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> a, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> b, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Ord.html#t:Ord">Ord</a> a) => <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> a b -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a></li></ul></div><div id="interface"><h1 id="g:1">Basic Utilities</h1><div class="top"><p class="src"><a name="v:flipM" class="def">flipM</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Ord.html#t:Ord">Ord</a> key, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Ord.html#t:Ord">Ord</a> val) => <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> key val -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> val [key]</p><div class="doc"><p>Flips a Map. See <code><a href="Data-List-Utils.html#v:flipAL">flipAL</a></code> for more on the similar
|
|
function for lists. </p></div></div><div class="top"><p class="src"><a name="v:flippedLookupM" class="def">flippedLookupM</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Ord.html#t:Ord">Ord</a> val, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Ord.html#t:Ord">Ord</a> key) => val -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> key val -> [key]</p><div class="doc"><p>Returns a list of all keys in the Map whose value matches the
|
|
parameter. If the value does not occur in the Map, the empty
|
|
list is returned. </p></div></div><div class="top"><p class="src"><a name="v:forceLookupM" class="def">forceLookupM</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> key, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Ord.html#t:Ord">Ord</a> key) => <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a> -> key -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> key elt -> elt</p><div class="doc"><p>Performs a lookup, and raises an exception (with an error message
|
|
prepended with the given string) if the key could not be found.</p></div></div><h1 id="g:2">Conversions</h1><div class="top"><p class="src"><a name="v:strToM" class="def">strToM</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Read.html#t:Read">Read</a> a, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Read.html#t:Read">Read</a> b, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Ord.html#t:Ord">Ord</a> a) => <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> a b</p><div class="doc"><p>Converts a String into a String, String Map. See
|
|
<code><a href="Data-List-Utils.html#v:strToAL">strToAL</a></code> for more on the similar function for association
|
|
lists.</p><p>This implementation is simple:</p><pre>strToM = Data.Map.fromList . strToAL</pre><p>This function is designed to work with Map String String objects,
|
|
but may work with other key/value combinations if they have simple
|
|
representations. </p></div></div><div class="top"><p class="src"><a name="v:strFromM" class="def">strFromM</a> :: (<a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> a, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Text-Show.html#t:Show">Show</a> b, <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-Ord.html#t:Ord">Ord</a> a) => <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2/Data-Map-Lazy.html#t:Map">Map</a> a b -> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a></p><div class="doc"><p>Converts a String, String Map into a string representation.
|
|
See <code><a href="Data-List-Utils.html#v:strFromAL">strFromAL</a></code> for more on the similar function for
|
|
association lists. This implementation is simple:</p><pre>strFromM = strFromAL . Data.Map.toList</pre><p>This function is designed to work with Map String String objects,
|
|
but may also work with other objects with simple representations. </p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.0</p></div></body></html> |