Is there a way to curry this: ```suspend fun Flow&...
# arrow
d
Is there a way to curry this:
Copy code
suspend fun Flow<AllStates>.assertTransition(oldState: AllStates, newState: AllStates) {
    ...
}
// into (by providing the oldState argument...):
suspend fun Flow<AllStates>.assertTransition(newStates: AllStates) {
    ...
}
I think I need partially3 and to change the order of oldState and newState...
y
Just use a lambda:
Copy code
val assertTransitionCurried: suspend Flow<AllStates>.(AllStates) -> Unit = { assertTransition(it) }
d
Yeah, that's probably simpler in this case... 😊. I wonder where all these partials and currieds really come to use then?
y
They come to use when there's a simple case. Keep in mind though that Kotlin, by design, doesn't work well with function composition and transformations like that. The "Kotlin way" is to use lambdas to transform the shape of functions