reduceMap and scan1Map require only a Semigroup