catch

open infix suspend fun <E, A> suspend EffectScope<E>.() -> A.catch(recover: suspend EffectScope<R>.(E) -> A): A

Deprecated

This method is renamed to recover in the new Raise type.Apply the ReplaceWith refactor, and then a simple find & replace of arrow.core.continuations.* to arrow.core.raise.* will do the trick. Add missing imports and you're good to go!

Replace with

recover(f)

When the Effect has shifted with R it will recover the shifted value to A, and when it ran the computation to completion it will return the value A. catch is used in combination with attempt.

import arrow.core.Either
import arrow.core.None
import arrow.core.Option
import arrow.core.Validated
import arrow.core.continuations.effect
import io.kotest.assertions.fail
import io.kotest.matchers.shouldBe

suspend fun main() {
effect<String, Int> {
val x = Either.Right(1).bind()
val y = Validated.Valid(2).bind()
val z =
attempt { None.bind { "Option was empty" } } catch { 0 }
x + y + z
}.fold({ fail("Shift can never be the result") }, { it shouldBe 3 })
}