As I understand, a monoid $M$ is just a special kind of category; it has only one object and its morphisms can be composed through a composition operation. In principle, if $a$ is the object of the category, the composition operation should have the following signature:
$$ \circ: (a \rightarrow a) \times (a \rightarrow a) \rightarrow (a \rightarrow a) $$
However, in functional programming languages, the monoid's append has a different arity; for example in Haskell you have:
class Monoid a where mempty :: a -- ^ Identity of 'mappend' mappend :: a -> a -> a -- ^ An associative operation
Ideally, categorical composition and
mappend should be related i.e., we should be able to extract one from the other. But I cannot see why.