From d6a7737d4175495a9b552261e97f88e8a315c985 Mon Sep 17 00:00:00 2001 From: i-walker <46971368+i-walker@users.noreply.github.com> Date: Wed, 9 Mar 2022 23:54:40 +0100 Subject: [PATCH 1/2] resource tap --- arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api | 2 +- .../src/commonMain/kotlin/arrow/fx/coroutines/Resource.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api b/arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api index 2d5969e3fca..b00d98a3284 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api +++ b/arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api @@ -309,7 +309,7 @@ public abstract class arrow/fx/coroutines/Resource { public final fun parZip (Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function3;)Larrow/fx/coroutines/Resource; public final fun parZip (Lkotlin/coroutines/CoroutineContext;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function3;)Larrow/fx/coroutines/Resource; public static synthetic fun parZip$default (Larrow/fx/coroutines/Resource;Lkotlin/coroutines/CoroutineContext;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Larrow/fx/coroutines/Resource; - public final fun tap (Lkotlin/jvm/functions/Function2;)Larrow/fx/coroutines/Resource; + public final synthetic fun tap (Lkotlin/jvm/functions/Function2;)Larrow/fx/coroutines/Resource; public final fun use (Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun zip (Larrow/fx/coroutines/Resource;)Larrow/fx/coroutines/Resource; public final fun zip (Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function10;)Larrow/fx/coroutines/Resource; diff --git a/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/Resource.kt b/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/Resource.kt index 32d41b6e600..bac8e63da93 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/Resource.kt +++ b/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/Resource.kt @@ -208,6 +208,7 @@ public sealed class Resource { arrow.fx.coroutines.continuations.resource { f(bind()) } /** Useful for setting up/configuring an acquired resource */ + @Deprecated("use tap with the type Parameter [Nothing] for [B]", level = DeprecationLevel.HIDDEN) public fun tap(f: suspend (A) -> Unit): Resource = arrow.fx.coroutines.continuations.resource { bind().also { f(it) } } From e6e7f08b7433140b0c34f7c7f658b1e1253e378f Mon Sep 17 00:00:00 2001 From: i-walker <46971368+i-walker@users.noreply.github.com> Date: Thu, 10 Mar 2022 09:14:04 +0100 Subject: [PATCH 2/2] update api --- arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api | 2 +- .../src/commonMain/kotlin/arrow/fx/coroutines/Resource.kt | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api b/arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api index b00d98a3284..2d5969e3fca 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api +++ b/arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api @@ -309,7 +309,7 @@ public abstract class arrow/fx/coroutines/Resource { public final fun parZip (Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function3;)Larrow/fx/coroutines/Resource; public final fun parZip (Lkotlin/coroutines/CoroutineContext;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function3;)Larrow/fx/coroutines/Resource; public static synthetic fun parZip$default (Larrow/fx/coroutines/Resource;Lkotlin/coroutines/CoroutineContext;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Larrow/fx/coroutines/Resource; - public final synthetic fun tap (Lkotlin/jvm/functions/Function2;)Larrow/fx/coroutines/Resource; + public final fun tap (Lkotlin/jvm/functions/Function2;)Larrow/fx/coroutines/Resource; public final fun use (Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun zip (Larrow/fx/coroutines/Resource;)Larrow/fx/coroutines/Resource; public final fun zip (Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function10;)Larrow/fx/coroutines/Resource; diff --git a/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/Resource.kt b/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/Resource.kt index bac8e63da93..f8d41a404d5 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/Resource.kt +++ b/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/Resource.kt @@ -208,8 +208,7 @@ public sealed class Resource { arrow.fx.coroutines.continuations.resource { f(bind()) } /** Useful for setting up/configuring an acquired resource */ - @Deprecated("use tap with the type Parameter [Nothing] for [B]", level = DeprecationLevel.HIDDEN) - public fun tap(f: suspend (A) -> Unit): Resource = + public fun tap(f: suspend (A) -> Unit): Resource = arrow.fx.coroutines.continuations.resource { bind().also { f(it) } } public fun ap(ff: Resource<(A) -> B>): Resource =