It's me again. I am trying to wrap Client[F]. (I have Trace[F] instance there)
def apply[F[_]: Trace: Sync](client: Client[F]): Client[F] = {
Client[F] { request =>
val spanName: String = ???
for {
b <- Trace[F].span(spanName) { //should be F[]
}
//only have Resource[F, Response[F]] type for
//client.run(modifiedRequest))
} yield ???
}
}
Can't get how to transform Resource
to wrap it with Trace[F].span
Trace[F].span(“stream”)(s.compile.drain)
Stream.eval(Kleisli.ask).flatMap(span => Stream.resource(span.subspan("name"))) >> innerStream
F[_] : Trace
there's no way to have Stream[F, A]
that embeds a subspan without wrapping in an F[_]
given the present Trace
API, unless I specifically assume that F
is Kleisli
, is this correct? If so this seems to be a bit of a pain point for writing transparent wrappers around other libs that inolve Stream
, perhaps the API could be adjusted to accomodate scenarios like this?
Trace
constraint place nice with munit-cats-effect
between various projects and I was wondering if it would make sense to A. add an munit module to Natchez, B. add a Natchez module to munit-cats-effect, C. create a library independent of the two or D. not bother cos its only a wee bit of code