Apply f
to each element of fa
and combine them using the
given SemigroupK[G]
.
Apply f
to each element of fa
and combine them using the
given SemigroupK[G]
.
scala> import cats._, cats.data._, cats.implicits._ scala> val f: Int => Endo[String] = i => (s => s + i) scala> val x: Endo[String] = NonEmptyList.of(1, 2, 3).reduceMapK(f) scala> val a = x("foo") a: String = "foo321"