https://kotlinlang.org logo
#arrow
Title
# arrow
o

Ollis

06/24/2022, 5:57 PM
Hi, does anyone know if this feature is to be expected soon: https://github.com/arrow-kt/arrow-core/issues/203 I really miss the opportunity to compose suspended functions 😄
n

Norbi

06/24/2022, 6:24 PM
I think instead of adding suspending versions of the functions, they should be `inline`d instead...
1
s

simon.vergauwen

06/27/2022, 7:17 AM
Sadly with
inline
this will not work because the return type is determined by the signature. So it either returns
() -> A
or
suspend () -> A
but it cannot be both. Sadly is in Arrow Core is not great. It requires to define all different combinations of functions, and it quickly explodes the binary of the core library. Which is a bit counterproductive. Arrow has been waiting and hoping for compiler plugins for a long time, and they're almost here 🤞 We should be able to replace this with a compiler plugin that can change your code in-place to support currying, partial application, composition etc. That way there would be 0 functions in the binary, and only some synthetic sugar is offered as API.
😮 2
o

Ollis

06/27/2022, 6:40 PM
We should be able to replace this with a compiler plugin that can change your code in-place to support currying, partial application, composition etc.
That sounds really good! 🤞 for compiler plugins.
2 Views