<br>
<br><tt><font size=2>Jefferson Heard <jeff@renci.org> wrote on 03/06/2007
03:18:40 PM:<br>
<br>
> Nope, I'm asking why <br>
> <br>
> um . IntMap.elems . IntMap.IntersectionWith (\x y -> x*y) queryVector
<br>
> rationalProjection<br>
> <br>
> won't work.<br>
> </font></tt>
<br><tt><font size=2>We have (simplifying away some typeclass details):</font></tt>
<br><tt><font size=2> </font></tt>
<br><tt><font size=2> sum . elems :: IntMap a -> a</font></tt>
<br>
<br><tt><font size=2>and:</font></tt>
<br>
<br><tt><font size=2> intersectionWith (*) :: IntMap a ->
IntMap a -> IntMap a</font></tt>
<br>
<br><tt><font size=2>but:</font></tt>
<br>
<br><tt><font size=2> ((sum . elems) .) :: (IntMap a ->
IntMap a) -> IntMap a -> a</font></tt>
<br>
<br><tt><font size=2>so you need something like: </font></tt>
<br>
<br><tt><font size=2> 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>