Implementing CataMonoid.