I think `groupedSum` can be tightened up a bit if you use a `BufferedIterator` (a simple wrapper over `Iterator` that gives you access to `head`, which lets you peak at the next element in the iterator without consuming it):

```scala
  def groupedSum[K1, V1: Semigroup](in: Iterator[(K1, V1)]): Iterator[(K1, V1)] = {
    new Iterator[(K1, V1)] {
      private val bufferedIt = in.buffered
      def hasNext = bufferedIt.hasNext
      def next() = {
        @tailrec
        def sum(acc: (K1,V1)): (K1, V1) = {
          if (hasNext) {
            (acc, bufferedIt.head) match {
              case ((ka, va), (k, v)) if ka == k =>
                bufferedIt.next()
                sum((k, Semigroup.plus(va, v)))
              case _ => acc
            }
          } else acc
        }
        sum(bufferedIt.next())
      }
    }
  }
```

Sample:

```scala
scala> groupedSum(Iterator((1,1),(1,2),(1,3),(2,4),(3,5),(3,1),(6,6))).foreach(println)
(1,6)
(2,4)
(3,6)
(6,6)
```