Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example of Trace instance for IO #1108

Merged
merged 4 commits into from
Dec 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion modules/docs/src/main/paradox/reference/trace.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,11 @@ This is more general than the `Kleisli` instance above and allows you to instant

Given a `Span[F]` you can construct a `Trace[IO]` for **Cats-Effect 3** (for Cats-Effect 2 you will need to use `Kleisli` or `Local` above). This uses `FiberLocal` to pass the span around.

TODO: Example
```scala mdoc
import cats.effect.IO

def goIO(span: Span[IO]): IO[Unit] =
Trace.ioTrace(span).flatMap { implicit trace =>
wibble[IO]("bob", 42)
}
```
Loading