Why not make it unlossy and have:<div><br></div><div>trans :: (Ord k, Ord a) =&gt; Map k a -&gt; Map a (Set k)</div><div><br></div><div><br></div><div><br><div class="gmail_quote">On Thu, Jun 16, 2011 at 9:10 AM, Johan Tibell <span dir="ltr">&lt;<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Thu, Jun 16, 2011 at 3:01 PM, Dmitri O.Kondratiev &lt;<a href="mailto:dokondr@gmail.com">dokondr@gmail.com</a>&gt; wrote:<br>

&gt; Hi,<br>
&gt; Data.Map has many great functions, yet I could not find the one that allows<br>
&gt; from one map create another map where keys are values and values are keys of<br>
&gt; the first one.<br>
&gt; Something like:<br>
&gt; transMap:: (Ord k, Ord a) =&gt; Map k a -&gt; Map a k<br>
&gt;<br>
&gt; Does such function exist?<br>
<br>
</div></div>Note that such a function would be lossy as there might be duplicate<br>
values in the map.<br>
<br>
Cheers,<br>
Johan<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br></div>