在哪里可以找到 cats.NonEmptyParallel[IO,F]?

Where to find a cats.NonEmptyParallel[IO,F]?

这曾经有效:

val ioA = IO(...)
val ioB = IO(...)
val ioC = IO(...)
(ioA, ioB, ioC).parMapN((_, _, _) => ())

然后,在猫 1.0.0-RC2 附近或周围,它停止工作。现在我得到

could not find implicit value for parameter p: cats.NonEmptyParallel[cats.effect.IO,F]

而且我这辈子都想不出我需要什么才能让它重新工作。有谁知道我需要导入或传入什么(我已经尝试过隐式 Timer[IO])来备份和 运行?谢谢。

因为 RC3, Parallel instance of IO requires a ContextShift[IO] implicit 而不是 Timer[IO]

您可以从 IOApp 或通过 IO.contextShift(ec) 获得一个,其中 ecscala.concurrent.ExecutionContext