Hi all I noticed that I'm not able to call co-rou...
# arrow
r
Hi all I noticed that I'm not able to call co-routine methods within a flatMapped arrow Either. eg. Something like
Copy code
someEither.flatMap { someCoroutineMethod() <- // this causes an error - "Suspension functions can be called only within coroutine body" }
If we were to make flatMap an inline function (ie.
Copy code
inline fun <A, B, C> EitherOf<A, B>.flatMap(f: (B) -> Either<A, C>): Either<A, C> = ...
That would allow it to be called. This is similar to the .fold we have on Either. Is there a reason we shouldn't make this change?
c
What vesion are you using? In the most recent is possible call suspend functions from flatmap, map...
r
ah! I'm behind a version of two.
I'll try updating
c
👍