Union Types and Option Types
Summary
This technical blog post explains union types and the specific case of option types in Copper. It covers design constraints (no nested unions, order sensitivity, and incompatibility between unions), practical usage patterns (T|Nothing, T|Error), and runtime techniques like as checks, notNil, or else, and early returns. The author reflects on the trade-offs and questions whether the added complexity is worth it for a minimal language.