interop-cats icon indicating copy to clipboard operation
interop-cats copied to clipboard

Cats Effect: Stream & Sink

Open jdegoes opened this issue 5 years ago • 3 comments

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.

jdegoes avatar Apr 24 '19 15:04 jdegoes

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...

NeQuissimus avatar Apr 24 '19 18:04 NeQuissimus

This looks super interesting, i'll try to contribute it!

timo-schmid avatar Apr 24 '19 19:04 timo-schmid

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!

timo-schmid avatar Apr 27 '19 13:04 timo-schmid