``` fun <A> IO<A>.withRetry(err: Throw...
# arrow
p
Copy code
fun <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) }