This is more inline also with Arrow and Fx expecti...
# arrow
r
This is more inline also with Arrow and Fx expecting side effects including things that can fail inside suspension or IO
👍 1
j
Talking about side effects and the above posted snippet. How should I call that parseDate function in an Arrow Fx way? Throwing and catching is not pure. But we can always expect the same result back from the function. Should this be considered an unsafe operation?
r
parsing is unsafe and an effect and since it’s suspended you can use this function freely inside anywhere that is also suspended or lifting to IO with IO.effect or
fx { effect { ... } }
.
Copy code
val x: IO<Either<ParseDate, Date>> = IO.effect { "boom".parseDate() }
j
👍