~zainab/blog

0f855ece856dd9185c2880504c0e875145206bcb — zainab-ali 6 months ago bbafd16
Correct factorial function in cats-effect-ioruntime post
M src/chapters/2022-02-12-cats-effect-ioruntime/snippets.md => src/chapters/2022-02-12-cats-effect-ioruntime/snippets.md +1 -1
@@ 109,7 109,7 @@ time(lotsOfSnoozes).unsafeRunSync()(basicRuntime)
val factorial: IO[Unit] = {
  @scala.annotation.tailrec
  def go(n: Long, total: Long): Long =
    if (n > 0) go(n - 1, total * n - 1) else total
    if (n > 1) go(n - 1, total * n) else total
  IO(go(2000000000L, 1)).void
}
```

M src/chapters/2022-02-12-cats-effect-ioruntime/snippets.out.md => src/chapters/2022-02-12-cats-effect-ioruntime/snippets.out.md +1 -1
@@ 128,7 128,7 @@ time(lotsOfSnoozes).unsafeRunSync()(basicRuntime)
val factorial: IO[Unit] = {
  @scala.annotation.tailrec
  def go(n: Long, total: Long): Long =
    if (n > 0) go(n - 1, total * n - 1) else total
    if (n > 1) go(n - 1, total * n) else total
  IO(go(2000000000L, 1)).void
}
```