07.3 Option and nullability
Option T is the only optional surface—no null, no optional keyword."
Option and nullability
If you type null expecting sympathy, you will receive diagnostics instead.
Option<T> only
Section titled “Option<T> only”Optional presence must use Option<T> (corelib Query.Contracts.Option) or an explicit enum with a dedicated absent variant at API boundaries.
- Forbidden:
null,optionalkeyword,?Tsugar - Present / absent:
Option<T>::Some(x)/Option<T>::None(exact constructors per corelib)
Why the industry default is rejected
Section titled “Why the industry default is rejected”null made billion-dollar bugs feel normal. Beskid chooses explicit enums so absence shows up in match, not in a surprise NRE at runtime.
Handling options
Section titled “Handling options”Use match on options (see enums and match). Calling methods on a maybe-absent value without narrowing is a compile error—not a Friday production mystery.
flowchart TD
V[Value] --> M{match Option}
M -->|None| H0[handle absent]
M -->|Some| H1[use inner T]
Normative decisions
Section titled “Normative decisions”- D-LM-TYP-002 —
Option<T>only in Types - Glossary: glossary and conformance