[Haskell-cafe] Usage of . and $
jeff.polakow at db.com
Tue Mar 6 15:35:40 EST 2007
Jefferson Heard <jeff at renci.org> wrote on 03/06/2007 03:18:40 PM:
> Nope, I'm asking why
> um . IntMap.elems . IntMap.IntersectionWith (\x y -> x*y) queryVector
> won't work.
We have (simplifying away some typeclass details):
sum . elems :: IntMap a -> a
intersectionWith (*) :: IntMap a -> IntMap a -> IntMap a
((sum . elems) .) :: (IntMap a -> IntMap a) -> IntMap a -> a
so you need something like:
sum . elems . uncurry (intersectionWith (*)) $ (queryVector,
This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe