Use Seq#aggregate in more places.
Use Seq#aggregate in more places.

The aggregate method is optimized for parallel collections,
and possibly also some other structures. If users are using
Seq[A] then they are presumably less worried about boxing
and indirection and more likely to want to get the kinds of
benefits aggregate may provide.

This commit also introduces qmeanWith and qnormWith, which
take a mapping from the element type to a different type
which has a Field defined. This makes it possible to take
the average of an array of integers without allocating a
new collection, or trying to use iterators/views.

For example:

  val ints: Array[Int] = ...
  val avg: Double = ints.qmeanWith(_.toDouble)

kevinmeredith/spire,JackSullivan/spire,woparry/spire,AlecZorab/spire,adampingel/spire,AlecZorab/spire,tixxit/spire,adampingel/spire,JackSullivan/spire,non/spire,codeaudit/spire,rklaehn/spire,rklaehn/spire,woparry/spire,tixxit/spire,siddhartha-gadgil/spire,guersam/spire,kevinmeredith/spire,guersam/spire,codeaudit/spire,non/spire,siddhartha-gadgil/spire