import zio.{RIO, Task}
trait A
trait B
object Main {
val callsite: RIO[A, SomeResult] = {
val b = acquireB()
for {
x <- f /* <---- how to pass b there */
_ <- releaseB(b)
} yield x
}
val f: RIO[A with B, SomeResult] = ???
def acquireB(): B = ???
def releaseB(that: B): Task[Unit] = ???
type SomeResult = Int
}