What problem does it solve?
Understanding and implementing Cangjie-based enums with robust features like multiple constructors, non-exhaustive variants, recursion, and Equatable integration can be error-prone. This Skill consolidates rules and patterns to enable correct, maintainable enum definitions.
Core Features & Use Cases
- Enum definition with named constructors (with and without parameters) and support for recursive types.
- Handling conflicting constructor names and reserved keywords via escaping or renaming.
- Non-exhaustive enums using a final ... constructor, and ensuring type-safe usage with pattern matching.
- Inclusion of member functions, operators, and properties, plus optional Equatable derivation guidance.
- Real-world scenarios include designing a type-safe expression tree or a color enum with runtime checks.
Quick Start
Define a new Cangjie enum with named constructors and demonstrate one recursive usage example.