diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Either.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Either.kt
index 7ed8bb779d5..3733940fb55 100644
--- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Either.kt
+++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Either.kt
@@ -2274,15 +2274,12 @@ public inline fun Either.handleErrorWith(f: (A) -> Either)
}
@Deprecated(
- RedundantAPI + "Prefer the new recover API",
- ReplaceWith(
- "this.recover { f(it) }",
- "arrow.core.recover"
- )
+ RedundantAPI + "Prefer resolving the error with getOrElse.",
+ ReplaceWith("getOrElse(f).right()", "arrow.core.right", "arrow.core.getOrElse")
)
public inline fun Either.handleError(f: (A) -> B): Either {
contract { callsInPlace(f, InvocationKind.AT_MOST_ONCE) }
- return recover { a -> f(a) }
+ return getOrElse(f).right()
}
@Deprecated(