at that point you don't even need `value` or const...
# announcements
e
at that point you don't even need
value
or constraining the type to be `AndThen`:
Copy code
interface AndThen

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

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