> > 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