Last active
May 21, 2020 18:37
-
-
Save arosien/cabb122f37b4066f37ce0f796d873f57 to your computer and use it in GitHub Desktop.
Console.withOut
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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