An example of using macros (2.10) to generate a factory which instantiates traits.