We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d245ab commit b505165Copy full SHA for b505165
common/src/main/scala/io/iohk/atala/prism/utils/IOUtils.scala
@@ -0,0 +1,19 @@
1
+package io.iohk.atala.prism.utils
2
+
3
+import cats.Comonad
4
+import cats.effect.IO
5
+import cats.effect.unsafe.implicits.global
6
7
+object IOUtils {
8
9
+ // Needed for better integration with tests, see io.iohk.atala.prism.management.console.ManagementConsoleRpcSpecBase at 57 line
10
+ implicit val ioComonad: Comonad[IO] = new Comonad[IO] {
11
+ override def extract[A](x: IO[A]): A = x.unsafeRunSync()
12
13
+ override def coflatMap[A, B](fa: IO[A])(f: IO[A] => B): IO[B] =
14
+ IO.delay(f(fa))
15
16
+ override def map[A, B](fa: IO[A])(f: A => B): IO[B] = fa.map(f)
17
+ }
18
19
+}
0 commit comments