Is there a `Function1` equivalent for suspending f...
# arrow
p
Is there a
Function1
equivalent for suspending function / coroutines? https://arrow-kt.io/docs/0.10/apidocs/arrow-core-data/arrow.core/-function1/index.html
s
No, and that's not possible afaik. What is your use-case? We're deprecating and removing
Function1
.
r
Related in case anyone is interested https://youtrack.jetbrains.com/issue/KT-18707
p
My goal is to write functional pipelines; for instance i want to compose functions that are F1 andThen F2 andThen F3 (and other functions that are offered by Function1)
i’m hoping F1 can be a suspend func
my use case is basically this: i want to apply a sequence of linear transformations to some input type T, to convert it to output type F
s
p
yes that’d be great actually
i don’t know if there are generic suspend functions; it’d also be nice to have those functions that can intermingle w/ suspending and non-suspending function
s
A
suspend
lambda should work for non-suspending ones. In one of the latest 1.4.x version the added support for non-suspending lambda references to be used for suspend function arguments.
p
ok i might check it out