Make my ordered monoid thing more elegant