-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Context
We currently use two patterns for optional values:
- Use pointer values, where nil means not set.
- Use a pair of value and bool for each value, where the bool indicates whether the value is set or not.
Both of those have ergonomic issues and lead to lots of wonky code for handling the "not set" condition. Instead, we could use an optional type internally with an API like Rust's "Option" type.
See an example here.
Definition of done
What must be done to consider the task complete?
Pitfalls
What should the implementer watch out for? What are the risks?