[Haskell-cafe] Usage of . and $

Nicolas Frisby nicolas.frisby at gmail.com
Tue Mar 6 16:27:07 EST 2007


>  > sum . IntMap.elems . IntMap.IntersectionWith (\x y -> x*y) queryVector
>  > rationalProjection
>  >

Composition with (.) builds a function, but you eventually want an
Int, so we can't just use (.), but we can come pretty close.

(sum . IntMap.elems . IntMap.IntersectionWith (\x y -> x*y)
queryVector) rationalProjection


More information about the Haskell-Cafe mailing list