4 ms·
Sum types. Option<T> types which can have either Some(value) or Nothing for values. Statically compiled languages can typecheck this so you don’t have null poi
by srgpqt 8y ago
Sum types.
Option<T> types which can have either Some(value) or Nothing for values. Statically compiled languages can typecheck this so you don’t have null pointer errors.
Some languages like TypeScript have this baked into the language syntax, so you can do: let x: Foo | null = bar; and is also properly type checked.