Skip to content

Glossary: Kotlin Beyond the Basics

Outcome

Also written: Ok, Problem

A sealed interface, `Outcome<out T>`, for a result that is either `Ok(value)` for success or `Problem(message)` for failure. A `when` over it needs no `else` branch, and `Problem` fits any `Outcome<T>` because it is an `Outcome<Nothing>`.

Where the book teaches it

Related terms

sealed interfaceNothing