Hacker News new | ask | show | jobs
by exdsq 2113 days ago
Isn’t an endofunctor a morphism from/to the same category? So a functor would be any morphine from/to different categories, and that wouldn’t be an endofunctor?

Endofunctor: A -> A, for category A

Functor: A -> B, for categories A and B

2 comments

More or less. "Morphism" is defined by the category it lives in, so a functor is a morphism between categories in the category of (small) categories. (Insert technicalities about size concerns and Russell's paradox.)

In particular, a map between categories that does not preserve composition is not a functor. It is important that F(f;g) = F(f);F(g).

In the typical functional programmers view of category theory, there is only one category of interest so all functors are endofunctors. My main issue is that category theory the thing being studied is categories plural and so I feel like the language of category theory is being used to only ever talk about a single category.

It feels like doing “group theory” entirely with the symmetric group of the integers. While it’s true that the group is very general and has interesting properties, the focus of group theory isn’t single groups but rather the relationships between groups.

Compare this to something like algebraic topology or Galois theory where you have a Galois correspondence (a functor) between objects you’re interested in and groups.