diff --git a/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/ParMap.kt b/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/ParMap.kt index 751402ea818..f2ae6998d8b 100644 --- a/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/ParMap.kt +++ b/arrow-libs/fx/arrow-fx-coroutines/src/commonMain/kotlin/arrow/fx/coroutines/ParMap.kt @@ -15,12 +15,12 @@ import kotlin.coroutines.CoroutineContext import kotlin.coroutines.EmptyCoroutineContext public suspend fun <A, B> Iterable<A>.parMap( - ctx: CoroutineContext = EmptyCoroutineContext, + context: CoroutineContext = EmptyCoroutineContext, concurrency: Int, f: suspend CoroutineScope.(A) -> B ): List<B> { val semaphore = Semaphore(concurrency) - return parMap(ctx) { + return parMap(context) { semaphore.withPermit { f(it) } } }