Enums with Data
Enum constructors can carry parameters, and different constructors can have different parameter types and counts. This allows enums to express richer data structures.
Parameters are declared in parentheses after the constructor name, such as Circle(Float64) carrying one Float64 parameter, and Rectangle(Float64, Float64) carrying two.
In a match expression, you can extract the data carried by constructors through pattern matching. case Circle(r) => binds the circle's radius to variable r, which can be used directly in the code after =>.
The code on the right defines three shapes, each carrying different parameters. The area function extracts parameters through pattern matching and calculates the area.
Try adding a Square(Float64) member to represent a square, and handle it in both the area and describe functions.