https://gist.github.com/machuidel/d7cc099ddc4970c6ddf4
By adding more abstractions it should even be possible to support semigroups, monoids etc.
Of course this was just for fun.