Option[T]

typeOption[T]

An optional value.

The Option[T] is a variant type with two constructors: Some(T) and None. To get the value of an Option, you can either match on it or use the ? operator.

The notation T? is shorthand for Option[T].

For more information, see the language reference.