---
title: "Comment by sammo90 on \"Traversing Cats Effect IOs [Part-3]\" | Hashnode"
description: "extension [A](io: IO[A]) { def trace: IO[A] = for { res &lt;- io _ = println(s\"[${Thread.currentThread().getName}] \" + res) } yield res } Should read: extension"
url: "https://hashnode.com/posts/traversing-cats-effect-ios-part-3/62715202d64dcf11c4fb584f/comment/6a0315ed937b84f779721e92"
---

[Discussion](https://hashnode.com/posts/traversing-cats-effect-ios-part-3/62715202d64dcf11c4fb584f)

Comment [Traversing Cats Effect IOs \[Part-3\]](https://hashnode.com/posts/traversing-cats-effect-ios-part-3/62715202d64dcf11c4fb584f)

[sammo90](https://hashnode.com/@sammo90)

[May 12](https://hashnode.com/posts/traversing-cats-effect-ios-part-3/62715202d64dcf11c4fb584f/comment/6a0315ed937b84f779721e92)

```
extension [A](io: IO[A]) {
  def trace: IO[A] =
    for {
      res <- io
      _ = println(s"[${Thread.currentThread().getName}] " + res)
    } yield res
}
```

Should read:

```
extension [A](io: IO[A])
  def trace: IO[A] = for {
    res <- io
    _   <- IO.println(s"[${Thread.currentThread.getName}] " + res)
  } yield res
```
