the best I can offer (without annotation processin...
# announcements
e
the best I can offer (without annotation processing) is:
Copy code
interface AndThen<T>

inline fun <T : AndThen<T>, U> T.andThen(func: (T) -> AndThen<U>): AndThen<U> = func(this)
inline val <T : AndThen<T>> T.value get() = this

sealed class Result<T> : AndThen<Result<T>>
data class SuccessWithValue<T>(val result: T) : Result<T>()
class Success<T>() : Result<T>()
data class Failure<T>(val error: Exception) : Result<T>()