3

I'm using doobie which can produce an fs2.Stream[ConnectionIO, Int] of database rows (Int in my case). The ConnectionIO[A] is doobie's internal type.

Given a HKT F[_] and val nt: ConnectionIO ~> F is there a way to get fs2.Stream[F, Int] from fs2.Stream[ConnectionIO, Int]?

I didn't find some sort of mapK defined for fs2.Stream.

Some Name
  • 8,555
  • 5
  • 27
  • 77

1 Answers1

5

The method you're looking for is called translate, or translateInterruptible in some cases.

Matthias Berndt
  • 4,387
  • 1
  • 11
  • 25