What will be the result of applying combine to semigroup of type Option[Int]]
import cats.implicits._
import cats.kernel.Semigroup

Semigroup[Option[Int]].combine(Option(1), Option(2))
Explanation
Since both Options are non-empty, the combine function of Semigroup[Int] is applied, which is sum of Ints.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Scala quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes