我正在尝试编译流,但不知何故Compiler
不在范围内,需要什么上下文绑定才能将其纳入范围?
import cats.Monad
def compilingStream[F[_]: Monad]: F[List[Int]] = {
val stream: fs2.Stream[F, Int] = fs2.Stream.emit(1).covary[F]
stream.head.compile.toList
}
error: could not find implicit value for parameter compiler: fs2.Stream.Compiler[[x]F[x],G]
stream.head.compile.toList
^