Typed missing values
Represent typed absence, check presence and select explicitly typed payloads or defaults.
let missing: Optional<Float64> = Optional.none<Float64>()
let measured = Optional.some(3.5)
print(missing.is_none())
print(measured.is_some())
print(missing.unwrap_or(default: 0.0))
if measured.is_some() {
print(measured.unwrap())
}
let title: Optional<String> = Optional<String>("sample")
print(title.unwrap())
print(type(title))
Make it your experiment.
Use Aner 0.0.3 or newer. Save this program as examples/optional_basic.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.
aner check examples/optional_basic.aner
aner run examples/optional_basic.anerThe aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.
Use Aner 0.0.4 or newer with import free temporal, binary, Range, Optional and Result values, and VS Code extension 0.1.37 or newer. No import is required. Calendar values use Gregorian and explicit fixed offset contracts; Bytes uses strict explicit text encoding; Range is lazy; outcome payload access is checked. See each separate native value reference for exact ownership, resource limits and time/space complexity.
Bundled datasets retain their own source attribution and license notices. Example outcomes are not comparative benchmarks or evidence of clinical validity.
Dataset sources & attribution