melatonina
04/27/2020, 7:05 PMsuspend 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:
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?