redeem<B> method
Returns the value created from recover
or map
, depending on whether
this IO results in an error or is successful.
Implementation
IO<B> redeem<B>(
Function1<RuntimeException, B> recover, Function1<A, B> map) =>
attempt().map((a) => a.fold(recover, map));