repartition only needs a Semigroup