What will be the result of combineAll for the following Monoid?
import cats.implicits._
import cats.kernel.Monoid

Monoid[String].combineAll(List())
Explanation
Function combineAll can take List as a parameter. In current example, it is an empty list. Since Monoid is of type String, the combine is done for empty list of Strings that returns a zero value, which is an empty String.

Source: Scala Exercises: cats monoid

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Продовжуйте вивчати
тести з Scala
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести