dave08
12/18/2024, 11:45 AMdave08
12/18/2024, 11:51 AMdave08
12/23/2024, 10:58 AMpublic fun <T> MutableState<T>.updateCopy(block: Copy<T>.() -> Unit) {
update { it.copy(block) }
}
/**
* Updates the value in this [MutableStateFlow]
* by performing the operations in the [Copy] [block].
*/
public fun <T> MutableStateFlow<T>.updateCopy(block: Copy<T>.() -> Unit) {
update { it.copy(block) }
}
the update functions themselves are and would allow to call suspend funs from within them... so if these were too, we could use the current ui state to call the suspend fun and update it atomically...Youssef Shoaib [MOD]
12/30/2024, 9:08 PMAlejandro Serrano.Mena
02/07/2025, 7:50 AMCLOVIS
02/17/2025, 8:30 AMarrow.fx.coroutines.await.awaitAll marked experimental but arrow.fx.coroutines.await.AwaitAllScope isn't?CLOVIS
02/17/2025, 8:47 AMawaitAll ? I'm curious what's stopping itphldavies
02/18/2025, 7:53 PMputOrRaise (and similar) helpers that take a payload parameter (implicitly receiving a la fun <reified B: Any> Route.put(String, (B) -> Unit): Route I'm hitting an overload ambiguity between the following:
inline fun <reified B : Any, reified R> Route.putOrRaise(
path: String,
crossinline body: suspend RaiseRoutingContext.(B) -> R,
): Route
and
public inline fun <reified R> Route.putOrRaise(
path: String,
crossinline body: suspend RaiseRoutingContext.() -> R,
): Route
when attempting to use the non-receiving form, i.e. putOrRaise("/path") { "my result" } .
You could disambiguate either with putOrRaise("/path") { -> "my result" } or putOrRaise<_>("/path") { "my result" } but neither are intuitive or ergonomic to write.
The only reasonable alternative I can think of is to rename the "receiving" helpers like putOrRaiseReceiving or putReceivingOrRaise or such, but again, not very ergonomic.
Any other thoughts or ideas? Do we even need/want to include a "receiving" form of these, given a consumer could just use put<B>("/path") { respondOrRaise { "my result " } or putOrRaise("/path") { val it = receiveOrRaise<T>() } as needed?raulraja
02/22/2025, 1:04 PMphldavies
02/26/2025, 1:47 PMarrow-kt/suspendapp or arrow-kt/arrow given it's a fairly important fix
i.e. would a 0.5.1 release be worth cutting from arrow-kt/suspendapp
how is versioning of suspendapp going to follow from the merge into arrow-kt/arrow?phldavies
03/03/2025, 10:33 AMYoussef Shoaib [MOD]
03/14/2025, 9:02 AM@BuilderInference is useless nowadays, although for some reason it hasn't been deprecated yet? Should we remove it to clean up the codebase a bit?Youssef Shoaib [MOD]
03/14/2025, 9:11 AMcombine function in Arrow, do we assume that such functions are associative?phldavies
03/21/2025, 9:07 AMsimon.vergauwen
03/27/2025, 9:51 AMsimon.vergauwen
03/27/2025, 4:23 PMAlejandro Serrano.Mena
04/20/2025, 4:16 PMphldavies
04/22/2025, 11:46 AMList<A>.asNonEmptyListUnsafe() that avoids copying and simply wraps the list (potentially with a require(isNotEmpty()) check? (same for NonEmptySet) - currently the suggested replacement for the old Nel.fromListUnsafe is list.toNonEmptyListOrNull() ?: error(...) however this currently iterates the list twice (effectively doing iterator().let { listOf(it.next()) + Iterable { it }.toList() })Alejandro Serrano.Mena
04/24/2025, 8:57 AMList (instead of copying it). Any feedback is welcome -> https://github.com/arrow-kt/arrow/pull/3611phldavies
04/29/2025, 3:54 PMphldavies
05/17/2025, 7:59 PMimport arrow.core.raise.Raise
import arrow.core.raise.either
context(r: Raise<String>)
fun doSomething(): Unit = TODO()
context(r: Raise<Int>)
fun doSomething(): Unit = TODO()
fun main() {
either<String, Unit> {
either<Int, Unit> {
doSomething() // Overload resolution ambiguity between candidates:
// context(r: Raise<String>) fun doSomething(): Unit
// context(r: Raise<Int>) fun doSomething(): Unit
}
}
}
whereas declaring with
fun Raise<String>.doSomething(): Unit = TODO()
fun Raise<Int>.doSomething(): Unit = TODO()
resolves correctly - but this doesn't work for cases where you already have a receiver, obviously.
Even labelling the closest either with intRaise@{ and wrapping with context(this@intRaise) { doSomething() } doesn't resolve it.
Neither does attempting to use a contextual alternative either constructor:
inline fun <Error, A> either(block: context(Raise<Error>) () -> A): Either<Error, A> = arrow.core.raise.either(block)phldavies
06/10/2025, 11:58 AMAbstractCollection.toString())?CLOVIS
07/05/2025, 6:04 PMYoussef Shoaib [MOD]
07/08/2025, 9:51 PMval continued = when {
collector.has(Characteristics.CONCURRENT, Characteristics.UNORDERED) ->
started.parMapUnordered(concurrency) { collector.accumulate(accumulator, it) }
collector.has(Characteristics.CONCURRENT) ->
started.parMap(concurrency) { collector.accumulate(accumulator, it) }
else -> started.map { collector.accumulate(accumulator, it) }
Specifically, parMap. From looking at its code, it seems that it's only ordered in the results that it produces (which are all Unit in this case), but the mapping itself happens in the same exact way as parMapUnordered. It thus seems unnecessarily expensiveYoussef Shoaib [MOD]
07/11/2025, 11:57 PMLeft and Right is valid for both? As in Either <: Ior, Left <: Either, Right <: Either, Both <: IorTanvi Goyal
08/17/2025, 8:19 AMphldavies
09/18/2025, 10:00 AMYoussef Shoaib [MOD]
09/23/2025, 9:08 PMblah.copy {
a = x
b = y
}
It feels doable, no?
In fact, couldn't we already do this with delegated properties? I might investigate...
Seems like it'd need contexts if we used delegated properties, and currently there's no context support for delegates.
The assign approach may thus be better.phldavies
10/03/2025, 11:17 AMcatch(block, transform, catch) override? Currently doing the equivalent of catch({ transform(block()) }, catch) would result in any exceptions from transform being handled by the catch function.Alejandro Serrano.Mena
10/22/2025, 10:21 AM2.2.0-beta.4 release, that should help people test the changes
Given the second point, I would love to find people willing to test the new Optics Gradle plug-in in their projects, to see if it works correctly.