What will be the result of applying function combine for options, one of which is empty?
import cats.implicits._
import cats.kernel.Semigroup

Semigroup[Option[Int]].combine(Option(1), None)
Explanation
If one of the Options is empty when applying combine function, the other option is returned.

Source: Scala Exercises: cats semigroup

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback