I have created two macros exactly for this purpose! [https://github.com/andreaferretti/patty](https://github.com/andreaferretti/patty)
The first one, called `variant` or `variantp` (for public), generate the types and the three constructor functions. The second one, called `match`, can be used to implement `getText`
