4 ms·
Maybe you mean functors instead of endofunctors (an endofunctor goes from a category to itself)? But that's a minor quibble, the main problem is I don't underst
by omaranto 13y ago
Maybe you mean functors instead of endofunctors (an endofunctor goes from a category to itself)? But that's a minor quibble, the main problem is I don't understand which categories you mean? What are the objects and morphisms? My best guess (and I have to guess because you didn't say) is that you mean to treat String and [String] as monoids and thus as one object categories. That is String is the category with a single object, the morphisms from that object to itself are all the possible strings and composition is concatenation; and similarly for [String] with list concatenation. If that's what you meant several things are wrong:
1. split(" ") is not a functor because (x+y).split(" ") is not equal to x.split(" ") + y.split(" "), for example:
"a BC".split(" ") == ["a", "BC"], but
"a B".split(" ") == ["a B"] and "C".split(" ") == ["C"].
(At least join(" ") is a functor, which here just means monoid homomorphism.) I guess this problem could be fixed by replacing String with StringsThatAreEitherEmptyOrEndInSpace (you need the empty string to be the identity for composition).
2. They are not adjoint, even after fixing the monoids to make them homomorphisms! It's easy to easy that if f and g are adjoint monoid homomorphisms, with unit η and counit ε, then the functions m ⟼ ε f(m) and n ⟼ g(n) η are inverses of each other. This does not happen here since, for example, join(' ') is not injective.
Can you fix the example, maybe by regarding them as categories in some other way? My gut feeling is that this won't work, but I haven't thought about it very much.
If, as I suspect, this adjointness is wrong and not easily fixable, does it still have value as an explanation? I think that's a personality question, I find it more confusing than enlightening, but can imagine some people would find it helpful.
- tel 13y agoI'm not trying to defend the example in detail—I agree that they don't have an obvious, rigorous categorical connection. I broadly think that with so little polymorphism you're not going to get a terrific categorical reading. I agree with the op that they still "feel" adjoint and may have a better reading there with a little generalization. But yeah, it's not the greatest example. I don't mean to defend it as something rigorous.
- jfarmer 13y agoYes, I was specifically talking about the feeling of adjointness. Moments lik those made me think something categorical was happening somewhere.