Skip to content

Commit

Permalink
Fixes on tutorial code
Browse files Browse the repository at this point in the history
  • Loading branch information
luisrodero-fidesmo committed Jul 25, 2023
1 parent d9ff585 commit ad36948
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ of the bytes transferred.

```scala mdoc:compile-only
import cats.effect.IO
import cats.syntax.all._
import java.io._

def transfer(origin: InputStream, destination: OutputStream, buffer: Array[Byte], acc: Long): IO[Long] =
Expand Down Expand Up @@ -820,7 +819,7 @@ The producer, for its part, will:
Thus the producer will look like:

```scala mdoc:compile-only
import cats.effect.{Deferred, Ref, Sync}
import cats.effect.{Async, Deferred, Ref}
import cats.effect.std.Console
import cats.syntax.all._
import scala.collection.immutable.Queue
Expand All @@ -836,7 +835,7 @@ def producer[F[_]: Async: Console](id: Int, counterR: Ref[F, Int], stateR: Ref[F
val (taker, rest) = takers.dequeue
State(queue, rest) -> taker.complete(i).void
case State(queue, takers) =>
State(queue.enqueue(i), takers) -> Sync[F].unit
State(queue.enqueue(i), takers) -> Async[F].unit
}.flatten

for {
Expand Down

0 comments on commit ad36948

Please sign in to comment.