interop-cats
interop-cats copied to clipboard
Cats Effect: Stream & Sink
Introduce an effect-polymorphic class atop ZStream
& ZSink
, with a default implementation for any Cats Effect data type (Cats IO, Monix Task, etc.).
package scalaz.zio.interop
trait Stream[F[_], +A] {
...
}
object Stream {
...
}
trait Sink[F[_], A, ...] { ... }
object Sink { ... }
The methods will all delegate to ZIO ZStream
and ZSink
, but they will take the ZIO
effects returned by ZStream
/ZSink
methods and lift it into any effect F[_]
that is suitable equipped.
Once you have this, we should be able to bring in FS2 pretty easily, no? Just today had a situation where I needed to interop with FS2...
This looks super interesting, i'll try to contribute it!
I've mostly copied the ideas from zio/zio#791 - feel free to let me know if I'm on the right track, or if I misunderstood anything!