<@UBD6YCVAR> suggested I could play more with the ...
# arrow
s
@Leandro Borges Ferreira suggested I could play more with the Hangman and abstract over the container. Here is the result: https://gist.github.com/LordRaydenMK/0be8f70f860a862e69daf262b4a83e17 is
Async
the right typeclass? Do you see anything I could do better?
l
Hey @stojan. You could do this, instead of throwing exceptions:
Copy code
fun <F> getStrLn(A: MonadDefer<F>): Kind<F, String> =
    A.run {
        A.defer {
            readLine().toOption()
                .fold({
                    raiseError<String>(IOException("Failed to read input!"))
                }, {
                    just(it)
                })
        }
    }
👌 1
s
Thanks for the tip @Leandro Borges Ferreira