Skip to content

Commit

Permalink
Merge branch 'main' into renovate/all
Browse files Browse the repository at this point in the history
  • Loading branch information
i-walker committed May 25, 2022
2 parents d489686 + 4562d1f commit b6d8727
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -94,8 +94,10 @@ public interface EagerEffect<out R, out A> {
public fun toOption(orElse: (R) -> Option<@UnsafeVariance A>): Option<A> =
fold(orElse, ::Some)

@Deprecated(deprecateMonadAppFunctorOperators, ReplaceWith("flatMap { eagerEffect { f(it) } }"))
public fun <B> map(f: (A) -> B): EagerEffect<R, B> = flatMap { a -> eagerEffect { f(a) } }

@Deprecated(deprecateMonadAppFunctorOperators)
public fun <B> flatMap(f: (A) -> EagerEffect<@UnsafeVariance R, B>): EagerEffect<R, B> = eagerEffect {
f(bind()).bind()
}
Expand Down Expand Up @@ -195,3 +197,5 @@ public inline fun <R, A> eagerEffect(crossinline f: suspend EagerEffectScope<R>.
}
}
}

private const val deprecateMonadAppFunctorOperators: String = "Operators related to Functor, Applicative or Monad hierarchies are being deprecated in favor of bind"

0 comments on commit b6d8727

Please sign in to comment.