哪里可以找到一只猫。非空并行[IO,F]?

问题描述 投票:1回答:1

这曾经工作:

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

然后,在Cats 1.0.0-RC2附近或周围,它停止了工作。现在我明白了

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

我无法弄明白我的生活需要让它再次运作。有没有人知道我需要导入或传入(我已经尝试了一个隐含的Timer[IO])来恢复和运行?谢谢。

scala scala-cats
1个回答
2
投票

RC3,IO requires a ContextShift[IO] implicit的并行实例而不是Timer[IO]

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

© www.soinside.com 2019 - 2024. All rights reserved.