This sentence in the Arrow guides is misleading: "...
# arrow
a
This sentence in the Arrow guides is misleading: "Complementing the Kotlin Coroutines library, Arrow Fx adds an extra layer of safety to concurrent and asynchronous programming so you’re well aware of where effects are localized in your apps." TIL - Arrow is not using JetBrain's coroutine library (https://github.com/Kotlin/kotlinx.coroutines), the wording should be "Competing" or "As an alternative to the Kotlin Coroutines library". Thoughts? (Thanks to @simon.vergauwen for chatting with me about it.)
The section I am referring to is in the Conclusion section on this page: https://arrow-kt.io/docs/fx/#conclusion
s
Most accurately described it would probably be something like “Arrow Fx offers a purely functional lazy runtime for Kotlin’s suspend system with side-effect tracking and monad comprehensions. It contains an
IO
type, which is equivalent to
suspend () -> A
and many powerful concurrency primitives like
Semaphore
,
Ref
,
Promise
, etc. They all guarantee resource safety, while offering powerful concurrent and parallel combinators and automatically cancellation support. (In the future also
suspend () -> Either<E, A>
) In contrast to KotlinX Coroutines, which offers an eager implementation of Kotlin’s suspend system with cooperative cancellation support and a cold stream implementation.”
😍 5
r
With meta suspension and IO are isomorphic and also coherced automatically
So all the IO api will be projected over suspend functions eliminating most of the wrapping in favor of imperative syntax across the board that is easy to newcomers and people not used to nested style in FP
When we wrote that conclusion IO was not as far from coroutines as it is now but it clearly differentiates not just in eager vs lazy but in the way it automatically handles cancellation and safe resource handling
We believe for a fair ecosystem of suspension, cancellation should be part of the std lib suspension intrinsics
2