IT lexicon › Programming › Optional / Maybe type

Optional / Maybe type

Programming På svenska → Updated: 2026-05-24

Type that explicitly can be "empty" — Option<T> in Rust, T? in Kotlin/Swift, Maybe T in Haskell.

Forces you to handle both cases at compile time — no more NullPointerException. Different from null which "sneaks" into the type. A driving force in modern language design. TypeScript with strictNullChecks gives the same guarantee.

← Back to the lexicon