raulraja
08/24/2018, 11:06 PMTry
even when being unable to suspend effects. When we run: Try { println("whatever") }
the effect is immediately executed, not suspended and exceptions are still captured. It is true though that since MonadDefer
and IO
extend or provide instances of MonadError<F, Throwable>
when you call MonadDefer<F>#invoke
or IO#invoke
if when the IO loop runs whatever you placed in there threw an exception it would be encapsulated and it would not blow the stack and you can get it back whenever you want with attempt
or handle|handleWith