Hey all, kotlin nab here. So I have an monad-esque...
# coroutines
b
Hey all, kotlin nab here. So I have an monad-esque data structure that helps me track error states. So I can make conditional function calls like:
Copy code
data.onSuccess{ value -> networkCall(value)}
    .onError{ error -> reportError(error)}
Now the problem is that this won't work because you cannot call a suspend fun from within a lambda. Currently, I am solving this by having a
data.onSucccessSuspend(...)
function to handle this case. Is this an anti-pattern? Are there easier ways to deal with "nested" suspend funs?