Skip to content

Commit b505165

Browse files
author
Shota Jolbordi
committed
Fix compilation issue
Signed-off-by: Shota Jolbordi <[email protected]>
1 parent 8d245ab commit b505165

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)