Skip to content

Instantly share code, notes, and snippets.

@arosien
Last active May 21, 2020 18:37
Show Gist options
  • Save arosien/cabb122f37b4066f37ce0f796d873f57 to your computer and use it in GitHub Desktop.
Save arosien/cabb122f37b4066f37ce0f796d873f57 to your computer and use it in GitHub Desktop.
Console.withOut
import cats.effect.IO
import java.io.ByteArrayOutputStream
val out = new ByteArrayOutputStream
val cookies = IO(println("cookies"))
Console.withOut(out) { cookies.unsafeRunSync() }
out.toString // "cookies\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment