Enum Specialization
You are special, like the enum types
Each branch or instance of the enum can also be used to represent the specific type. This allows us to write straight forward functions which expect a specific value of the enum. This approach eliminates the over-use of the match expression as a way to decide datatypes inside a function.
We can write the specialization functions like this.
This is how to use them.
Last updated