---
title: "sammo90 (@sammo90) | Hashnode"
description: "sammo90 (@sammo90) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@sammo90"
---

@sammo90

# sammo90

@sammo90 · Joined May 2026

## Comments

[Function "accessWashroom" currentTime code is incomplete. Something like: def accessWashroom(person: String, sem: Semaphore\[IO\]): IO\[Unit\] = for { t0 <- IO(System.currentTimeMillis()) \_ <- IO(s"\[+ 0 ms\] $person wants to access the washroom, waiting for getting the access").trace \_ <- sem.acquire t1 <- IO(System.currentTimeMillis()) \_ <- IO(s"\[+ \\({t1 - t0} ms\] \\)person got access to washroom and using it now").trace \_ <- IO.sleep(5.second) t2 <- IO(System.currentTimeMillis()) \_ <- IO(s"\[+ \\({t2 - t0} ms\] \\)person left the washroom").trace \_ <- sem.release } yield () does the job.](https://hashnode.com/posts/synchronisation-and-concurrent-access-in-cats-effect-3-part-7/628eab0143220290a7eeb6da/comment/6a081d8c5adec46063438ac2)

Comment · Article · May 16 · [Synchronisation and Concurrent Access in Cats Effect 3 \[Part 7\]](https://hashnode.com/posts/synchronisation-and-concurrent-access-in-cats-effect-3-part-7/628eab0143220290a7eeb6da)

[Using Scala 3.8.3 (Windows 10): I get the warning: Compiling project (Scala 3.8.3, JVM (temurin:21)) \[warn\] .\\yadu9.sc:51:38 \[warn\] method onError in class IO is deprecated since 3.6.0: Use onError with PartialFunction argument \[warn\] val loggedFailedError\_1: IO\[Int\] = failedIO.onError(ex => IO.println("It failed with message: "+ex.getMessage)) \[warn\] ^^^^^^^^^^^^^^^^ Compiled project (Scala 3.8.3, JVM (temurin:21)) \[io-compute-1\] 500 \[io-compute-blocker-1\] -2 \[io-compute-2\] -2 \[io-compute-blocker-1\] 0 \[io-compute-blocker-1\] 0 \[io-compute-blocker-1\] -9 It failed with message: Boom! Exception in thread "main" java.lang.RuntimeException: Boom! ... Code section is: val errorIO = IO(100/0) val recoveredFailedIO\_1: IO\[Int\] = errorIO.recover { case ex: ArithmeticException => -9 } // deprecated: method onError in class IO is deprecated since 3.6.0: Use onError with PartialFunction argument val loggedFailedError\_1: IO\[Int\] = failedIO.onError(ex => IO.println("It failed with message: "+ex.getMessage)) // new: val loggedFailedError: IO\[Int\] = failedIO.onError {case ex => IO.println(s"It failed with message: ${ex.getMessage}")}](https://hashnode.com/posts/error-handling-in-cats-effect-part-9/64452d9126baa38eee9138f2/comment/6a003fc2e3eebc2e20505ac5#reply-6a0737d673afc887577d3396)

Reply · Article · May 15 · [Error Handling in Cats Effect \[Part-9\]](https://hashnode.com/posts/error-handling-in-cats-effect-part-9/64452d9126baa38eee9138f2)

[Wouldn't it be better to use \_ <- IO.println(... instead of \_ = println( ... ?](https://hashnode.com/posts/synchronisation-and-concurrent-access-in-cats-effect-3-part-7/628eab0143220290a7eeb6da/comment/6a0705ceb54b0a065f49b586)

Comment · Article · May 15 · [Synchronisation and Concurrent Access in Cats Effect 3 \[Part 7\]](https://hashnode.com/posts/synchronisation-and-concurrent-access-in-cats-effect-3-part-7/628eab0143220290a7eeb6da)

[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](https://hashnode.com/posts/traversing-cats-effect-ios-part-3/62715202d64dcf11c4fb584f/comment/6a0315ed937b84f779721e92)

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

[In the last code example, the indentation is incorrect.](https://hashnode.com/posts/concurrent-execution-in-cats-effect-using-fibers/6278c77fc2a8c278735c90bf/comment/6a030ac3937b84f7796805fe)

Comment · Article · May 12 · [Concurrent Execution in Cats Effect using Fibers \[Part 4\]](https://hashnode.com/posts/concurrent-execution-in-cats-effect-using-fibers/6278c77fc2a8c278735c90bf)

[def example6 = val io1 = IO("Scala6") val io2 = IO("Cats6") val listTraverse = Traverse\[List\] // a typeclass instance -> import cats.implicits.toTraverseOps val ioList: List\[IO\[String\]\] = List(io1, io2) val insideOutIOs: IO\[List\[String\]\] = listTraverse.sequence(ioList) // is equal to the sequence-method: // val seqAsTraverse: IO\[List\[String\]\] = listTraverse.traverse(ioList)(identity) val traversedList: IO\[List\[String\]\] = listTraverse.traverse(ioList)(io => io.map(\_ + "!")) traversedList.trace Due to the import, no typeclass instance is needed anymore! def example7 = import cats.implicits.toTraverseOps val io1 = IO("Scala7") val io2 = IO("Cats7") val ioList: List\[IO\[String\]\] = List(io1, io2) val insideOutIOs: IO\[List\[String\]\] = ioList.sequence val traversedList: IO\[List\[String\]\] = ioList.traverse(io => io.map(\_ + "!")) traversedList.trace](https://hashnode.com/posts/traversing-cats-effect-ios-part-3/62715202d64dcf11c4fb584f/comment/6a02e240937b84f77943a0b9)

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

[// deprecated: method onError in class IO is deprecated since 3.6.0: Use onError with PartialFunction argument: val loggedFailedError: IO\[Int\] = failedIO.onError(ex => IO.println("It failed with message: "+ex.getMessage)) // new: val loggedFailedError: IO\[Int\] = failedIO.onError {case ex => IO.println(s"It failed with message: ${ex.getMessage}")}](https://hashnode.com/posts/error-handling-in-cats-effect-part-9/64452d9126baa38eee9138f2/comment/6a003fc2e3eebc2e20505ac5)

Comment · Article · May 10 · [Error Handling in Cats Effect \[Part-9\]](https://hashnode.com/posts/error-handling-in-cats-effect-part-9/64452d9126baa38eee9138f2)

[We can use the method attempt to lift the value of an IO into an Either. If the IO failed, it lifts the value as Right, otherwise into a Left: vice versa!](https://hashnode.com/posts/error-handling-in-cats-effect-part-9/64452d9126baa38eee9138f2/comment/6a003ec9e3eebc2e204fa2b4)

Comment · Article · May 10 · [Error Handling in Cats Effect \[Part-9\]](https://hashnode.com/posts/error-handling-in-cats-effect-part-9/64452d9126baa38eee9138f2)
