A monad is a monoid in the category of endofuctors. Category is a set of two things:
- Set of elements
- Set of binary operations between these elements.
When we talk about the category endofunctors we also have a set of two things:
- Set of endofuctors
Function compositionsas binary operations
Function composition is a thing where we apply one functor to an input and then apply another (or the same one) to the result of the previous one. So here is my question: if we don't compose functions does it mean that the whole thing is no longer a monad? Or no compositions is still a set of binary operations, just an empty one?
We can hear them say: a set of integers is a monoid **under addition** (binary operation). So, it makes me think that for a Maybe functor (which I am not even sure it is a functor, since Maybe is an object and a functor is a method (See my previous question)) to be a monad, function composition absolutely must exist there. But unlike the situation with set of integers and a binary operation, with Maybe structure we can achieve something useful without chaining anything at all. It means that if we use a Maybe once, the whole thing is not a monad; but if we use the output of it as an input for another functor call (hence function composition; hence binary operation) then it is a monad! Am I right?
Thanks