-
-
Save CremboC/264a1d3a93e6cd0d279504b8eec3883f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cats._ | |
import cats.implicits._ | |
import cats.effect.IO | |
implicit def ioMonoid[A: cats.Monoid]: cats.Monoid[IO[A]] = new Monoid[IO[A]] { | |
override def empty: IO[A] = IO(Monoid[A].empty) | |
override def combine(x: IO[A], y: IO[A]): IO[A] = x.flatMap(_ => y) | |
} | |
Monoid[IO[Option[Int]].empty | |
// could not find implicit value for parameter ev: cats.kernel.Monoid[cats.effect.IO[Option[Int]]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment