Hi, should’t be there `List.traverse` version acce...
# arrow
h
Hi, should’t be there
List.traverse
version accepting
suspend
since arrow have Fx Coroutines? (context in thread)
I have my own extension on Arrow 0.11:
Copy code
suspend fun <T, L, R> List<T>.traverseEffect(f: suspend (T) -> Either<L, R>): Either<L, List<R>>
Normal
traverse
/
parTraverse
don’t accept suspend functions, so I sadly must have workaround, using
IO.effect
.
usage with retrofit suspend + either client:
Copy code
either {
  val categories = !supportedTrees.traverseEffect { categoryCoreClient.getCategories(it.value) }
  ...
}
j
Every traversable that can be folded with inline functions and thus allows suspend in those should support that soon. map is usually just a fold followed by an unfold anyway. We are in the process of providing arrows method inline where ever possible to allow this. If the mapping/folding is not inline this won't work sadly and you will have to do
IO.effect
I guess.
h
Ok, thanks 😉
j
We want to provide better interop with suspend to make those interactions seamless. inline is the best way to do that ^^
h
Thank you. 😄