pakoito
04/25/2019, 9:35 PMfun <A> IO<A>.withRetry(err: Throwable, count: Int, shouldRetry: (count: Int, error: Throwable) -> Boolean) =
if (!shouldRetry(err, count)) IO.raiseError(err)
else handleErrorWith { withRetry(it, retries + 1, shouldRetry) }