Hello, again. I often find myself in need to call ...
# arrow
m
Hello, again. I often find myself in need to call
suspend
functions inside the
map
or
flatMap
functions of
Option<T>
or
Either<A, B>
. This is not possible, so I ended up writing the inline versions of those methods, like:
Copy code
inline fun <T, S> Option<T>.inlineMap(block : (T) -> S) =
    when(this) {
        is None -> None
        is Some -> block(t).some()
    }
Am I doing something wrong? Could you please explain to me what's the rationale behind those methods not being declared inline in first place?