I am busy reading Bartosz Milewski's Category Theory book for programmers and I'm struggling with the depiction of non-identity morphisms when moving between describing a monoid as a set and a monoid as a category.
I understand that when viewing a monoid (eg. a string) in the context of as a set, we are interested in describing various functions that make use of the 'append' characteristic, for example a function that appends "dog" or a function that appends "mmm" to whatever input it receives. These functions will, respectively, map their input to another element within the set of strings. This obviously includes the possibility of appending nothing.
When we view this monoid in the context of as a category, as far as I understand, we are zooming out to a level of abstraction where this monoid object represents the entire 'string' type and we are no longer interested in how elements are mapped to each other within this type, as we have represented this entire type as a singular dot/object.
Following from this, I would assume that at this level of abstraction, all functions that were described in the 'Set' context would look identical, as they all map string -> string. In my mind, this means that in the context of a category, the identity function (appending nothing) would look identical to the AppendDog or AppendMmm functions mentioned earlier, or any other function for that matter.
My reasoning is obviously incorrect though, as looking at this diagram in the book, morphisms that go from the monoid object to itself, are shown as unique entities:
As a closing statement/summary: I do not understand why we are still interested in depicting functions within a monoid set once we have abstracted it to a category. Once the set becomes an object in a category, where that object represents the entire type, would all functions within that set not all look like identity functions, as from our new vantage point, they all seem to start from that type and return to that type.
I hope I've made my confusion clear. Thanks in advance for any help!
f, g : A -> A
, it's the composition operator that says whetherf . g
and/org . f
"equal" the identity morphism, not anything else inherent inf
org
. – Veron