added an example of abstracting over types and functions using monoids and endomorphisms