Here is my implementation of a simple aggregation.
val mapping = Map("AA" -> "A", "AB" -> "A", "B" -> "B")
val input = Map("AA" -> 1, "AB" -> 1, "B" -> 1)
val output = input.groupBy { case (k, _) => mapping(k) }
.mapValues(_.values.sum)
Is there a smarter implementation using scalaz ?