<br>
<br><tt><font size=2>Jefferson Heard &lt;jeff@renci.org&gt; wrote on 03/06/2007
03:18:40 PM:<br>
<br>
&gt; Nope, I'm asking why <br>
&gt; <br>
&gt; um . IntMap.elems . IntMap.IntersectionWith (\x y -&gt; x*y) queryVector
<br>
&gt; rationalProjection<br>
&gt; <br>
&gt; won't work.<br>
&gt; </font></tt>
<br><tt><font size=2>We have (simplifying away some typeclass details):</font></tt>
<br><tt><font size=2>&nbsp;</font></tt>
<br><tt><font size=2>&nbsp; &nbsp; sum . elems :: IntMap a -&gt; a</font></tt>
<br>
<br><tt><font size=2>and:</font></tt>
<br>
<br><tt><font size=2>&nbsp; &nbsp; intersectionWith (*) :: IntMap a -&gt;
IntMap a -&gt; IntMap a</font></tt>
<br>
<br><tt><font size=2>but:</font></tt>
<br>
<br><tt><font size=2>&nbsp; &nbsp; ((sum . elems) .) :: (IntMap a -&gt;
IntMap a) -&gt; IntMap a -&gt; a</font></tt>
<br>
<br><tt><font size=2>so you need something like: </font></tt>
<br>
<br><tt><font size=2>&nbsp; &nbsp; sum . elems . uncurry (intersectionWith
(*)) $ (queryVector, rationalProjection)</font></tt>
<br>
<br><tt><font size=2>-Jeff</font></tt>
<br>
<br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">---</span><br>
<br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">This e-mail may contain confidential and/or privileged information. If you </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">are not the intended recipient (or have received this e-mail in error) </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">please notify the sender immediately and destroy this e-mail. Any </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">unauthorized copying, disclosure or distribution of the material in this </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">e-mail is strictly forbidden.</span><br>