diff --git a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/EagerEffect.kt b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/EagerEffect.kt index 6af3702ba07..557b398e672 100644 --- a/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/EagerEffect.kt +++ b/arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/continuations/EagerEffect.kt @@ -94,8 +94,10 @@ public interface EagerEffect { public fun toOption(orElse: (R) -> Option<@UnsafeVariance A>): Option = fold(orElse, ::Some) + @Deprecated(deprecateMonadAppFunctorOperators, ReplaceWith("flatMap { eagerEffect { f(it) } }")) public fun map(f: (A) -> B): EagerEffect = flatMap { a -> eagerEffect { f(a) } } + @Deprecated(deprecateMonadAppFunctorOperators) public fun flatMap(f: (A) -> EagerEffect<@UnsafeVariance R, B>): EagerEffect = eagerEffect { f(bind()).bind() } @@ -195,3 +197,5 @@ public inline fun eagerEffect(crossinline f: suspend EagerEffectScope. } } } + +private const val deprecateMonadAppFunctorOperators: String = "Operators related to Functor, Applicative or Monad hierarchies are being deprecated in favor of bind"