For those of you that have seen and reviewed <@U0R...
# arrow-contributors
r
For those of you that have seen and reviewed @simon.vergauwen work in the suspend library over the last 4 weeks introducing suspend without IO and the same power please show your approval or comments here today. This is going in today to get a snapshot ready for Kotliners. https://github.com/arrow-kt/arrow-fx/pull/169
😍 8
👏 7
arrow 9
p
More concise, ...., More idiomatic 👌
Is there use cases where we cannot use the new suspend DSL ?
s
No, you can use it everywhere and it exposes no unsafe APIs
Similar to what you’d expect from
IO
expect for the wrapping
r
Essentially eliminates the need for IO and transformers like EitherT
p
Due to a professional meeting, I could not attend Kotliners. Hopefully the videos will be online soon... So, I ask a question here: if i've this API
Copy code
MyClass<F> : Async<F> {
fun <A> myfun(use: suspend MonadThrowSyntax<F>.(MyDataClass) -> A): Kind<F, A> = fx. ...
}
If I understood correctly, with the new DSL, I can write
Copy code
MyClass {}
suspend fun <A> MyClass.myfun(use: suspend (MyDataClass) -> A): A = ...
or
suspend fun <A> MyClass.myfun(use: suspend (MyDataClass) -> A): Either<MyError, A> = ...
}
Exact ?
s
Yes, that’s 100% correct
Have you checked the
README
in the PR? It covers most of these topics there
Otherwise feel free to ask more questions here, the idea is that that
README
will become the
Quick start
section for the library. So all information you think is missing I’d love to know, so I can write it down for future reference when working on the docs 😉
p
Thx