When encountering a null value for Safeable often you just want to map that to one of the existing enum values and one can do that in the accessing code with Elvis operator and perhaps some added parentheses, but it would seem to me that it would improve readability if Safeable had a method like:
fun valueOrElse(defaultValue: T) = value ?: defaultValue
When encountering a null value for Safeable often you just want to map that to one of the existing enum values and one can do that in the accessing code with Elvis operator and perhaps some added parentheses, but it would seem to me that it would improve readability if Safeable had a method like: