Recursive Enums
Enum constructor parameters can be the enum type itself, forming recursive data structures. Such enums are often used to represent tree structures, expressions, etc.
The Expr enum on the right represents an arithmetic expression: Num is a leaf node (basic value), while Add and Mul are branch nodes containing two sub-expressions.
Processing recursive enums typically requires recursive functions. The eval function recursively calculates the value of an expression: when encountering Num, it returns the value directly; when encountering Add or Mul, it recursively calculates the sub-expressions and then adds or multiplies them.
The show function converts an expression to a readable string form, also using recursive processing.
Try adding a Sub(Expr, Expr) member to represent subtraction, and handle it in both the eval and show functions.